/* ============================================================
   styles.css — 个人主页样式表（精简版）
   只包含当前 HTML 实际使用的样式
   ============================================================ */

/* ==================== CSS 变量：日间模式 ==================== */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f6f8fa;
    --bg-sidebar: #f0f2f5;
    --bg-card: #ffffff;
    --bg-card-hover: #f9fafb;
    --bg-tag: #e8ecf1;
    --bg-spec-table: #fafbfc;

    --text-primary: #1f2328;
    --text-secondary: #59636e;
    --text-tertiary: #818b98;
    --text-link: #0969da;
    --text-link-hover: #0550ae;

    --border-color: #d0d7de;
    --border-light: #e8ecf1;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.10);
    --shadow-avatar: 0 4px 16px rgba(0, 0, 0, 0.12);

    --accent: #0969da;
    --accent-light: #ddf4ff;
    --accent-subtle: #f0f8ff;

    --social-hover-bg: #e8ecf1;
    --social-hover-text: #1f2328;

    --scrollbar-thumb: #c1c7cd;
    --scrollbar-track: transparent;

    --toggle-bg: #f0f2f5;
    --toggle-text: #59636e;
    --toggle-hover-bg: #d0d7de;

    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s ease;
}

/* ==================== CSS 变量：夜间模式（自动跟随系统） ==================== */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-primary: #0d1117;
        --bg-secondary: #161b22;
        --bg-sidebar: #161b22;
        --bg-card: #1c2128;
        --bg-card-hover: #22272e;
        --bg-tag: #2a3139;
        --bg-spec-table: #1c2128;

        --text-primary: #e6edf3;
        --text-secondary: #b1bac4;
        --text-tertiary: #768390;
        --text-link: #71b7ff;
        --text-link-hover: #a5d0ff;

        --border-color: #30363d;
        --border-light: #262c34;

        --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
        --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
        --shadow-avatar: 0 4px 20px rgba(0, 0, 0, 0.5);

        --accent: #71b7ff;
        --accent-light: #0d2d4e;
        --accent-subtle: #0d1b2a;

        --social-hover-bg: #2a3139;
        --social-hover-text: #e6edf3;

        --scrollbar-thumb: #484f58;
        --scrollbar-track: #161b22;

        --toggle-bg: #2a3139;
        --toggle-text: #b1bac4;
        --toggle-hover-bg: #3a424d;
    }
}

/* 手动设置为夜间模式 */
[data-theme="dark"] {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-sidebar: #161b22;
    --bg-card: #1c2128;
    --bg-card-hover: #22272e;
    --bg-tag: #2a3139;
    --bg-spec-table: #1c2128;

    --text-primary: #e6edf3;
    --text-secondary: #b1bac4;
    --text-tertiary: #768390;
    --text-link: #71b7ff;
    --text-link-hover: #a5d0ff;

    --border-color: #30363d;
    --border-light: #262c34;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-avatar: 0 4px 20px rgba(0, 0, 0, 0.5);

    --accent: #71b7ff;
    --accent-light: #0d2d4e;
    --accent-subtle: #0d1b2a;

    --social-hover-bg: #2a3139;
    --social-hover-text: #e6edf3;

    --scrollbar-thumb: #484f58;
    --scrollbar-track: #161b22;

    --toggle-bg: #2a3139;
    --toggle-text: #b1bac4;
    --toggle-hover-bg: #3a424d;
}

/* 手动设置为日间模式 */
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f6f8fa;
    --bg-sidebar: #f0f2f5;
    --bg-card: #ffffff;
    --bg-card-hover: #f9fafb;
    --bg-tag: #e8ecf1;
    --bg-spec-table: #fafbfc;

    --text-primary: #1f2328;
    --text-secondary: #59636e;
    --text-tertiary: #818b98;
    --text-link: #0969da;
    --text-link-hover: #0550ae;

    --border-color: #d0d7de;
    --border-light: #e8ecf1;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.10);
    --shadow-avatar: 0 4px 16px rgba(0, 0, 0, 0.12);

    --accent: #0969da;
    --accent-light: #ddf4ff;
    --accent-subtle: #f0f8ff;

    --social-hover-bg: #e8ecf1;
    --social-hover-text: #1f2328;

    --scrollbar-thumb: #c1c7cd;
    --scrollbar-track: #ffffff;

    --toggle-bg: #f0f2f5;
    --toggle-text: #59636e;
    --toggle-hover-bg: #d0d7de;
}


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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
    transition: background-color var(--transition-slow), color var(--transition-slow);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans",
    "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei",
    "Hiragino Sans GB", sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color var(--transition-slow), color var(--transition-slow);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--text-link);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--text-link-hover);
}

/* ==================== 主题切换按钮 ==================== */
.theme-toggle {
    top: 20px;
    right: 20px;
    z-index: 1000;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: var(--toggle-bg);
    color: var(--toggle-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.theme-toggle:hover {
    background: var(--toggle-hover-bg);
    box-shadow: var(--shadow-md);
    transform: scale(1.05);
}

.theme-toggle:active {
    transform: scale(0.95);
}

/* 日间/夜间图标切换 */
#themeIconSun { display: inline-block; }
#themeIconMoon { display: none; }

[data-theme="dark"] .theme-toggle #themeIconSun,
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle #themeIconSun {
        display: none;
    }
    :root:not([data-theme="light"]) .theme-toggle #themeIconMoon {
        display: inline-block;
    }
}
[data-theme="dark"] .theme-toggle #themeIconMoon { display: inline-block; }
[data-theme="dark"] .theme-toggle #themeIconSun { display: none; }
[data-theme="light"] .theme-toggle #themeIconSun { display: inline-block; }
[data-theme="light"] .theme-toggle #themeIconMoon { display: none; }


/* ==================== 主容器布局 ==================== */
.main-container {
    display: flex;
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 24px;
    gap: 32px;
}

/* ==================== 左侧边栏 ==================== */
.sidebar {
    flex: 0 0 320px;
    width: 320px;
    background: var(--bg-sidebar);
    border-radius: 16px;
    padding: 36px 28px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    position: sticky;
    top: 40px;
    align-self: flex-start;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    transition: all var(--transition-normal);
}

/* 头像 */
.avatar-wrapper {
    margin-bottom: 20px;
}

.avatar {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--border-color);
    box-shadow: var(--shadow-avatar);
    transition: all var(--transition-normal);
    background: var(--bg-card);
}

.avatar:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}

/* 圈名 */
.profile-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    letter-spacing: -0.01em;
    line-height: 1.3;
    word-break: break-word;
}

/* 一句话介绍 */
.profile-bio {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 18px;
    line-height: 1.5;
    word-break: break-word;
}

/* 位置与时区信息 */
.profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-bottom: 22px;
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.meta-item i {
    font-size: 0.9rem;
    color: var(--text-tertiary);
}

/* 社交链接 */
.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    width: 100%;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

.social-link:hover {
    background: var(--social-hover-bg);
    color: var(--social-hover-text);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.social-link i {
    font-size: 1rem;
    width: 18px;
    text-align: center;
}

/* 平台图标特定颜色 */
.social-link .fa-bilibili { color: #fb7299; }
.social-link:hover .fa-bilibili { color: #fb7299; }
.social-link .fa-github { color: #333; }
[data-theme="dark"] .social-link .fa-github { color: #e6edf3; }
.social-link .fa-x-twitter { color: #1d9bf0; }
.social-link .fa-youtube { color: #ff0000; }
.social-link .fa-envelope { color: #ea4335; }


/* ==================== 右侧内容区 ==================== */
.content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 卡片 */
.card {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    padding: 24px 28px;
    transition: all var(--transition-normal);
    overflow: hidden;
}

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

.card-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.01em;
}

.card-title i {
    color: var(--accent);
    font-size: 1.1rem;
}

.card-body {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
}

.card-body p {
    margin-bottom: 12px;
}

.card-body p:last-child {
    margin-bottom: 0;
}

/* 硬件配置表（单个表格内部） */
.spec-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
    font-size: 0.9rem;
}

.spec-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.spec-table td:first-child {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    width: 80px;
    background: var(--bg-spec-table);
    border-radius: 6px 0 0 6px;
}

.spec-table td:first-child i {
    color: var(--accent);
    margin-right: 6px;
    font-size: 0.85rem;
}

.spec-table td:last-child {
    color: var(--text-secondary);
    padding-left: 16px;
}

.spec-table tr:last-child td {
    border-bottom: none;
}

/* ==================== PC DIY 三表格横向布局 ==================== */
.spec-tables-grid {
    display: flex;
    gap: 20px;
    margin-top: 12px;
}

.spec-table-wrapper {
    flex: 1;
    min-width: 0;
}

.spec-table-wrapper h3 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.spec-table-wrapper .spec-table {
    width: 100%;
}

/* 项目按钮 */
.project-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.project-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 20px;
    background: var(--accent);
    color: #fff !important;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-fast);
    border: none;
    cursor: pointer;
}

.project-button:hover {
    background: var(--accent-hover, #0550ae);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
    color: #fff;
}


/* ==================== 页脚 ==================== */
.site-footer {
    text-align: center;
    padding: 20px 24px;
    color: var(--text-tertiary);
    font-size: 0.85rem;
    border-top: 1px solid var(--border-light);
    margin-top: auto;
    line-height: 1.8;
}

.footer-line {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: baseline;
    gap: 0.3em 0.6em;
    margin-bottom: 4px;
}

.footer-line:last-child {
    margin-bottom: 0;
}

.footer-sep {
    user-select: none;
    color: var(--text-tertiary);
    opacity: 0.6;
}

.site-footer a {
    color: var(--text-link);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.site-footer a:hover {
    color: var(--text-link-hover);
    text-decoration: underline;
}


/* ==================== 自定义滚动条 ==================== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}


/* ============================================================
   响应式设计
   ============================================================ */

/* 平板及以下（≤1024px） */
@media (max-width: 1024px) {
    .main-container {
        padding: 28px 16px;
        gap: 20px;
    }

    .sidebar {
        flex: 0 0 280px;
        width: 280px;
        padding: 28px 20px 24px;
    }

    .avatar {
        width: 150px;
        height: 150px;
    }

    .profile-name {
        font-size: 1.3rem;
    }

    .content {
        gap: 16px;
    }

    .card {
        padding: 20px 22px;
    }
}

/* 移动端（≤768px） */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
        padding: 16px 12px;
        gap: 16px;
    }

    .sidebar {
        flex: none;
        width: 100%;
        position: static;
        max-height: none;
        border-radius: 14px;
        padding: 28px 20px 22px;
        box-shadow: var(--shadow-sm);
    }

    .avatar {
        width: 120px;
        height: 120px;
        border-width: 3px;
    }

    .profile-name {
        font-size: 1.25rem;
    }

    .profile-bio {
        font-size: 0.85rem;
        margin-bottom: 14px;
    }

    .profile-meta {
        font-size: 0.8rem;
        gap: 10px;
        margin-bottom: 18px;
    }

    .social-links {
        gap: 6px;
    }

    .social-link {
        padding: 6px 12px;
        font-size: 0.8rem;
        gap: 4px;
    }

    .social-link i {
        font-size: 0.9rem;
        width: 16px;
    }

    .content {
        gap: 14px;
    }

    .card {
        padding: 18px 16px;
        border-radius: 10px;
    }

    .card-title {
        font-size: 1.05rem;
        margin-bottom: 10px;
    }

    .card-body {
        font-size: 0.9rem;
    }

    .spec-table td {
        padding: 6px 8px;
        font-size: 0.82rem;
    }

    .spec-table td:first-child {
        width: 90px;
    }

    /* 三表格纵向堆叠 */
    .spec-tables-grid {
        flex-direction: column;
        gap: 16px;
    }

    .theme-toggle {
        top: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
        font-size: 0.95rem;
    }
}

/* 小屏手机（≤480px） */
@media (max-width: 480px) {
    .main-container {
        padding: 10px 8px;
        gap: 10px;
    }

    .sidebar {
        padding: 22px 14px 18px;
        border-radius: 10px;
    }

    .avatar {
        width: 100px;
        height: 100px;
        border-width: 2px;
    }

    .profile-name {
        font-size: 1.15rem;
    }

    .profile-bio {
        font-size: 0.8rem;
    }

    .profile-meta {
        flex-direction: column;
        gap: 4px;
        align-items: center;
    }

    .social-link span {
        display: none;
    }

    .social-link i {
        font-size: 1rem;
        width: auto;
    }

    .social-link {
        border-radius: 50%;
        width: 38px;
        height: 38px;
        justify-content: center;
        padding: 0;
    }

    .card {
        padding: 14px 12px;
        border-radius: 8px;
    }

    .card-title {
        font-size: 0.95rem;
    }

    .card-body {
        font-size: 0.85rem;
    }

    .spec-table td:first-child {
        width: 70px;
        font-size: 0.75rem;
    }

    .spec-table td:last-child {
        font-size: 0.75rem;
        padding-left: 8px;
    }

    .theme-toggle {
        top: 8px;
        right: 8px;
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }
}

/* ==================== 打印样式 ==================== */
@media print {
    .theme-toggle { display: none; }
    .sidebar { box-shadow: none; border: 1px solid #ccc; }
    .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
    body { background: #fff; color: #000; }
}


/* 右上角按钮容器 */
.top-right-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    gap: 8px;
}

/* 通用按钮样式 */
.icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: var(--toggle-bg);
    color: var(--toggle-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.lang-toggle {
    font-size: 0.9rem;
    font-weight: 600;
    width: auto;
    padding: 0 16px;
    border-radius: 21px;
}

.icon-btn:hover {
    background: var(--toggle-hover-bg);
    box-shadow: var(--shadow-md);
    transform: scale(1.05);
}

.icon-btn:active {
    transform: scale(0.95);
}