/* ===== 基础变量 ===== */
:root {
    --bg-primary: #0f1117;
    --bg-secondary: #1a1d2e;
    --bg-card: #232740;
    --bg-card-hover: #2a2f4a;
    --text-primary: #e8eaf0;
    --text-secondary: #9ca3b8;
    --accent: #6c8cff;
    --accent-glow: rgba(108, 140, 255, 0.15);
    --success: #4ade80;
    --border: rgba(255, 255, 255, 0.06);
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

/* ===== 重置 & 基础 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ===== 头部 ===== */
header {
    background: linear-gradient(135deg, #1a1d2e 0%, #232740 50%, #1a1d2e 100%);
    border-bottom: 1px solid var(--border);
    padding: 40px 20px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(108, 140, 255, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

.header-content {
    position: relative;
    z-index: 1;
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #fff, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ===== 主体 ===== */
main {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 16px 40px;
}

/* ===== 通用区块 ===== */
.section {
    margin-top: 32px;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 8px;
    padding-left: 4px;
}

.section-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 16px;
    padding-left: 4px;
}

/* ===== API 接口区 ===== */
.api-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.api-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 12px;
}

.api-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
    transform: translateY(-1px);
}

.api-item:active {
    transform: scale(0.98);
}

.api-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.api-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}

.api-dot.primary {
    background: var(--success);
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.5);
}

.api-name {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
}

.api-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 20px;
    background: rgba(108, 140, 255, 0.15);
    color: var(--accent);
    white-space: nowrap;
}

.api-badge.primary {
    background: rgba(74, 222, 128, 0.12);
    color: var(--success);
}

.api-url {
    font-size: 0.8rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.api-copy-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.2s;
}

.api-item:hover .api-copy-hint {
    opacity: 1;
}

/* ===== 工具卡片 ===== */
.tool-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tool-card {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    transition: all 0.2s ease;
    gap: 14px;
}

.tool-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(108, 140, 255, 0.3);
    transform: translateY(-1px);
}

.tool-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.tool-info {
    flex: 1;
    min-width: 0;
}

.tool-info h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.tool-info p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.tool-arrow {
    color: var(--text-secondary);
    font-size: 1.1rem;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.tool-card:hover .tool-arrow {
    transform: translateX(3px);
    color: var(--accent);
}

/* ===== APP 下载卡片 ===== */
.app-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.app-card {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    transition: all 0.2s ease;
    gap: 14px;
}

.app-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(108, 140, 255, 0.3);
    transform: translateY(-1px);
}

.app-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.app-info {
    flex: 1;
    min-width: 0;
}

.app-info h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.app-info p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.app-tag {
    font-size: 0.7rem;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(108, 140, 255, 0.12);
    color: var(--accent);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ===== 资源导航卡片 ===== */
.link-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.link-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px 12px;
    text-align: center;
    transition: all 0.2s ease;
    gap: 6px;
}

.link-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(108, 140, 255, 0.3);
    transform: translateY(-2px);
}

.link-icon {
    font-size: 1.8rem;
    margin-bottom: 4px;
}

.link-card h3 {
    font-size: 0.9rem;
    font-weight: 600;
}

.link-card p {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ===== Toast 提示 ===== */
.toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--bg-card);
    color: var(--success);
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid rgba(74, 222, 128, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===== 底部 ===== */
footer {
    text-align: center;
    padding: 24px 20px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
    margin-top: 20px;
}

/* ===== 响应式 ===== */
@media (min-width: 480px) {
    .app-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 600px) {
    header h1 {
        font-size: 2.4rem;
    }

    main {
        padding: 0 24px 60px;
    }
}
