/* ========== CSS 变量（浅色模式） ========== */
:root {
    --bg-gradient-start: #f9faff;
    --bg-gradient-end: #f0f3f8;
    --card-bg: #ffffff;
    --card-border: rgba(255, 255, 255, 0.6);
    --text-primary: #1e293b;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --text-faint: #d1d5db;
    --card-shadow: 0 4px 16px rgba(0, 0, 0, 0.04), 0 1px 4px rgba(0, 0, 0, 0.02);
    --card-shadow-hover: 0 12px 32px rgba(255, 107, 74, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
    --accent: #ff6b4a;
    --accent-bg: #fff1ed;
    --accent-border: #ffd6cc;
    --copy-bg: #f8fafc;
    --copy-border: #e2e8f0;
    --copy-badge-bg: #f1f5f9;
    --copy-badge-text: #94a3b8;
    --modal-bg: #ffffff;
    --modal-section-border: #e2e8f0;
    --close-bg: #f1f5f9;
    --close-hover-bg: #fee2e2;
    --close-hover-color: #ef4444;
    --highlight-glow: 0 0 0 3px rgba(255, 107, 74, 0.35);
}

/* ========== CSS 变量（深色模式） ========== */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-gradient-start: #0f172a;
        --bg-gradient-end: #1e293b;
        --card-bg: #1e293b;
        --card-border: rgba(255, 255, 255, 0.08);
        --text-primary: #f1f5f9;
        --text-secondary: #94a3b8;
        --text-muted: #64748b;
        --text-faint: #475569;
        --card-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), 0 1px 4px rgba(0, 0, 0, 0.2);
        --card-shadow-hover: 0 12px 32px rgba(255, 107, 74, 0.2), 0 4px 12px rgba(0, 0, 0, 0.3);
        --accent: #ff7a5c;
        --accent-bg: rgba(255, 107, 74, 0.15);
        --accent-border: rgba(255, 107, 74, 0.3);
        --copy-bg: #334155;
        --copy-border: #475569;
        --copy-badge-bg: #475569;
        --copy-badge-text: #cbd5e1;
        --modal-bg: #1e293b;
        --modal-section-border: #334155;
        --close-bg: #334155;
        --close-hover-bg: rgba(239, 68, 68, 0.2);
        --close-hover-color: #fca5a5;
        --highlight-glow: 0 0 0 3px rgba(255, 122, 92, 0.5);
    }
}

/* ========== 全局重置 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    min-height: 100vh;
    background: linear-gradient(145deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    display: flex;
    justify-content: center;
    padding: 2rem 1rem;
    overflow-x: hidden;
    color: var(--text-primary);
    transition: background 0.3s ease, color 0.3s ease;
}

body.modal-open {
    overflow: hidden;
}

.container {
    max-width: 1200px;
    width: 100%;
}

/* ========== 头部 ========== */
.header {
    text-align: center;
    margin-bottom: 3rem;
}

.header h1 {
    font-size: 3.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ff4d4d 0%, #ff7a2f 50%, #ffb347 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 400;
}

/* ========== 通用区块 ========== */
.section {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    padding-left: 1rem;
    border-left: 5px solid var(--accent);
    line-height: 1.2;
}

/* ========== 工具类网格 ========== */
.tools-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.tool-card {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    background: var(--card-bg);
    border-radius: 24px;
    padding: 1.5rem 2rem;
    box-shadow: var(--card-shadow);
    transition: all 0.25s ease;
    text-decoration: none;
    color: inherit;
    flex: 0 1 auto;
    min-width: 260px;
    border: 1px solid var(--card-border);
    cursor: pointer;
    user-select: none;
    touch-action: manipulation;
}

.tool-image {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--copy-bg);
}

.tool-info h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}

.tool-info .tool-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* 高亮效果 */
.tool-card.highlight {
    box-shadow: var(--highlight-glow), var(--card-shadow-hover);
    border-color: var(--accent);
    transform: translateY(-4px);
}

/* 娱乐类占位 */
.entertainment-placeholder {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 2.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 1rem;
    border: 2px dashed var(--copy-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

/* ========== 成员页 ========== */
.members-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    align-items: start;
}

.member-card {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--card-border);
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    user-select: none;
    touch-action: manipulation;
}

.member-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 0.75rem;
}

.member-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    flex: 1;
    min-width: 0;
}

.member-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--copy-bg);
    border: 2px solid var(--accent-border);
}

.member-avatar.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-faint);
    font-size: 1.2rem;
}

.member-role {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-bg);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 0.6rem;
    align-self: flex-start;
}

.member-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    flex: 1;
}

.member-desc.empty {
    color: var(--text-faint);
    font-style: italic;
}

/* ========== 底部信息 ========== */
.footer-info {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 2rem 2.5rem;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--card-border);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 2.5rem;
    align-items: center;
}

/* ========== 可复制项 ========== */
.copy-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    background: var(--copy-bg);
    padding: 0.6rem 1.2rem;
    border-radius: 16px;
    transition: all 0.2s ease;
    border: 1px solid var(--copy-border);
    user-select: none;
    font-size: 0.9rem;
    color: var(--text-primary);
    touch-action: manipulation;
    flex: 1;
    min-width: 0;
}

.copy-item:active {
    transform: scale(0.97);
}

.copy-item .label {
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: 0.2rem;
    white-space: nowrap;
}

.copy-item .value {
    font-weight: 500;
    color: var(--text-primary);
    word-break: break-all;
    flex: 1;
    min-width: 0;
}

.copy-item .copy-badge {
    font-size: 0.7rem;
    color: var(--copy-badge-text);
    background: var(--copy-badge-bg);
    padding: 0.15rem 0.5rem;
    border-radius: 8px;
    margin-left: 0.3rem;
    white-space: nowrap;
    transition: all 0.2s;
}

/* ========== 复制提示 Toast ========== */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(120%);
    background: var(--text-primary);
    color: var(--card-bg);
    padding: 0.75rem 2rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease;
    opacity: 0;
    pointer-events: none;
    z-index: 999;
}

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

/* ========== 模态框通用样式 ========== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-content {
    background: var(--modal-bg);
    color: var(--text-primary);
    max-width: 600px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 32px;
    padding: 2.5rem 2.8rem;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
    position: relative;
    animation: modalIn 0.3s ease;
    border: 1px solid var(--card-border);
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
    position: absolute;
    top: 1.2rem;
    right: 1.5rem;
    background: var(--close-bg);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    touch-action: manipulation;
    z-index: 10;
}

.modal-close:active {
    background: var(--close-hover-bg);
    color: var(--close-hover-color);
}

.modal-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.modal-dev {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.8rem;
    border-bottom: 1px solid var(--modal-section-border);
    padding-bottom: 1rem;
}

.modal-dev span:first-child {
    font-weight: 600;
    color: var(--text-primary);
}

.modal-dev span:last-child {
    color: var(--text-muted);
}

.modal-section {
    margin-bottom: 1.5rem;
}

.modal-section h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.modal-section p {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.95rem;
}

.modal-section p.empty {
    color: var(--text-faint);
    font-style: italic;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--modal-section-border);
}

.modal-btn {
    flex: 1;
    background: linear-gradient(135deg, #ff4d4d, #ff7a2f);
    color: #ffffff;
    text-decoration: none;
    padding: 0.9rem 1.5rem;
    border-radius: 18px;
    font-weight: 700;
    text-align: center;
    font-size: 1rem;
    transition: all 0.2s;
    box-shadow: 0 4px 16px rgba(255, 77, 77, 0.3);
    display: inline-block;
    touch-action: manipulation;
}

.modal-btn:active {
    transform: scale(0.98);
}

/* ========== 成员模态框专属样式 ========== */
.member-modal-content {
    max-width: 540px;
}

.member-modal-header {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 1.8rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--modal-section-border);
}

.member-modal-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--copy-bg);
    border: 3px solid var(--accent-border);
}

.member-modal-avatar.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-faint);
    font-size: 1.8rem;
    border-color: var(--copy-border);
}

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

.member-modal-name {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.member-modal-role {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-bg);
    padding: 0.25rem 0.8rem;
    border-radius: 20px;
    display: inline-block;
}

.member-modal-copy-section {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

/* 开发软件格子 */
.member-apps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
    margin-top: 0.8rem;
}

.submenu-app {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.2rem 0.5rem;
    background: var(--copy-bg);
    border: 1px solid var(--copy-border);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    touch-action: manipulation;
    user-select: none;
    text-align: center;
}

.submenu-app:active {
    transform: scale(0.95);
}

.submenu-app-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--card-bg);
}

.submenu-app-placeholder {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.submenu-app-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
    word-break: break-word;
}

/* ========== 仅在支持 hover 的设备上启用悬停效果 ========== */
@media (hover: hover) {
    .tool-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--card-shadow-hover);
        border-color: var(--accent-border);
    }

    .member-card:hover {
        box-shadow: var(--card-shadow-hover);
        border-color: var(--accent-border);
    }

    .copy-item:hover {
        background: var(--accent-bg);
        border-color: var(--accent-border);
        color: var(--accent);
    }

    .copy-item:hover .copy-badge {
        background: var(--accent);
        color: #ffffff;
    }

    .submenu-app:hover {
        border-color: var(--accent-border);
        background: var(--accent-bg);
        transform: translateY(-2px);
    }

    .modal-close:hover {
        background: var(--close-hover-bg);
        color: var(--close-hover-color);
    }

    .modal-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 24px rgba(255, 77, 77, 0.4);
    }
}

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

@media (max-width: 640px) {
    body {
        padding: 1.5rem 0.8rem;
    }

    .header h1 {
        font-size: 2.2rem;
    }

    .header p {
        font-size: 0.95rem;
    }

    .section-title {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }

    .members-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .tools-grid {
        gap: 1rem;
    }

    .tool-card {
        flex: 1 1 100%;
        padding: 1.2rem 1.5rem;
        gap: 1rem;
    }

    .tool-image {
        width: 48px;
        height: 48px;
        border-radius: 12px;
    }

    .tool-info h3 {
        font-size: 1.05rem;
    }

    .tool-info .tool-desc {
        font-size: 0.8rem;
    }

    .member-avatar {
        width: 40px;
        height: 40px;
    }

    .footer-info {
        flex-direction: column;
        align-items: stretch;
        padding: 1.2rem;
        gap: 0.8rem;
    }

    .copy-item {
        justify-content: space-between;
        flex-wrap: wrap;
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
    }

    .modal-content {
        padding: 1.8rem 1.5rem;
        border-radius: 24px;
        max-height: 90vh;
    }

    .modal-title {
        font-size: 1.5rem;
    }

    .modal-dev {
        font-size: 0.85rem;
        margin-bottom: 1.2rem;
    }

    .modal-section h3 {
        font-size: 1rem;
    }

    .modal-section p, .modal-section ul {
        font-size: 0.9rem;
    }

    .modal-actions {
        margin-top: 1.5rem;
        padding-top: 1.2rem;
    }

    .modal-btn {
        padding: 0.8rem 1.2rem;
        font-size: 0.95rem;
    }

    .modal-close {
        top: 0.8rem;
        right: 0.8rem;
        width: 36px;
        height: 36px;
        font-size: 1.2rem;
    }

    .member-modal-header {
        gap: 0.8rem;
        margin-bottom: 1.2rem;
        padding-bottom: 1rem;
    }

    .member-modal-avatar {
        width: 56px;
        height: 56px;
    }

    .member-modal-name {
        font-size: 1.1rem;
    }

    .member-apps-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }

    .submenu-app {
        padding: 0.8rem 0.4rem;
    }

    .submenu-app-icon, .submenu-app-placeholder {
        width: 36px;
        height: 36px;
    }

    .submenu-app-name {
        font-size: 0.7rem;
    }
}
