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

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --bg: #f8fafc;
    --bg-alt: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --success: #10b981;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 18px 40px -12px rgba(37, 99, 235, 0.28), 0 8px 20px rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease: cubic-bezier(0.4, 0, 0.2, 1);

    /* Glassmorphism variables */
    --glass-bg-alpha: 0.85;
    --glass-border-color: #ffffff;
    --glass-border-alpha: 0.3;
    --glass-blur: 10px;
    
    /* 流体字体 - 根据视口自适应 */
    --base-font-size: clamp(13px, 1vw + 0.5rem, 16px);
    --font-family: system;
    --hero-bg-alpha: 0.85;
    
    /* Custom text color */
    --custom-text-color: #1e293b;
}

/* 暗黑模式 */
body.dark {
    --primary: #3b82f6;
    --primary-dark: #60a5fa;
    --primary-light: #1e3a5f;
    --bg: #0f172a;
    --bg-alt: #1e293b;
    --text: #e2e8f0;
    --text-light: #94a3b8;
    --border: #334155;
    --success: #10b981;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 18px 40px -12px rgba(59, 130, 246, 0.45), 0 8px 20px rgba(0, 0, 0, 0.4);
    --custom-text-color: #e2e8f0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: var(--font-family), -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: var(--base-font-size);
    background: var(--bg);
    color: var(--custom-text-color, var(--text));
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 clamp(12px, 3vw, 24px);
}

/* ===== 顶部导航 ===== */
.navbar {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid var(--border);
    z-index: 100;
    transition: box-shadow 0.3s var(--ease), background 0.3s var(--ease), padding 0.3s var(--ease);
}

.navbar.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.92);
}

.nav-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(12px, 3vw, 24px);
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.logo {
    font-size: clamp(0.9rem, 2.5vw, 1.15rem);
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-menu {
    display: flex;
    gap: 6px;
    flex: 1;
    justify-content: center;
    min-width: 0;
}

.nav-menu a {
    color: var(--text);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-menu a::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(59, 130, 246, 0.2));
    opacity: 0;
    transition: opacity 0.3s;
}

.nav-menu a:hover {
    color: white;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border-color: rgba(37, 99, 235, 0.5);
}

.nav-menu a:hover::before {
    opacity: 1;
}

.nav-menu a:active {
    transform: translateY(0) scale(0.98);
}

.nav-menu a .nav-icon {
    font-size: 1.1em;
    position: relative;
    z-index: 1;
}

.nav-menu a span {
    position: relative;
    z-index: 1;
}

.nav-menu a[href="#skills"]::after,
.nav-menu a[href="#roadmap"]::after,
.nav-menu a[href="#projects"]::after,
.nav-menu a[href="#resources"]::after,
.nav-menu a[href="#interview"]::after,
.nav-menu a[href="#about"]::after {
    content: "";
    position: absolute;
    bottom: 2px;
    left: 15px;
    right: 15px;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    border-radius: 2px;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.nav-menu a:hover::after {
    transform: scaleX(1);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.menu-toggle span {
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: 0.3s;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 1rem;
    cursor: pointer;
    line-height: 1;
    transition: background 0.2s, transform 0.2s;
}

.theme-toggle:hover {
    background: var(--bg);
    transform: rotate(20deg);
}

/* 暗黑模式:导航栏与移动菜单适配 */
body.dark .navbar {
    background: rgba(15, 23, 42, 0.95);
}

body.dark .nav-menu.active {
    background: var(--bg-alt);
}

/* ===== Hero 首页 ===== */
.hero {
    background: linear-gradient(135deg, rgba(30, 58, 138, var(--hero-bg-alpha, 0.85)) 0%, rgba(37, 99, 235, var(--hero-bg-alpha, 0.85)) 50%, rgba(59, 130, 246, var(--hero-bg-alpha, 0.85)) 100%);
    background-size: 200% 200%;
    animation: heroGradient 12s ease infinite;
    color: #fff;
    padding: clamp(40px, 8vw, 80px) clamp(16px, 4vw, 24px);
    text-align: center;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, var(--glass-border-alpha));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 4px 20px rgba(0, 0, 0, 0.1);
    width: 100%;
    box-sizing: border-box;
}

.hero::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.12) 0%, transparent 50%);
    animation: heroFloat 18s linear infinite;
    pointer-events: none;
}

@keyframes heroGradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes heroFloat {
    0% { transform: translate(0, 0); }
    50% { transform: translate(-10%, 10%); }
    100% { transform: translate(0, 0); }
}

.hero-content {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    width: 100%;
    box-sizing: border-box;
}

.hero h1 {
    font-size: clamp(1.4rem, 5vw, 2.2rem);
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
    background: linear-gradient(90deg, #fff, #bfdbfe, #fff);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: titleShine 6s linear infinite;
    line-height: 1.3;
    word-break: break-word;
}

@keyframes titleShine {
    to { background-position: 200% center; }
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 0.9; transform: translateY(0); }
}

.hero-subtitle {
    font-size: clamp(0.85rem, 2.5vw, 1.1rem);
    opacity: 0.9;
    margin-bottom: clamp(20px, 4vw, 36px);
    animation: fadeUp 0.9s var(--ease) both;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: clamp(20px, 5vw, 50px);
    margin-bottom: clamp(20px, 4vw, 36px);
    flex-wrap: wrap;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-num {
    font-size: clamp(1.4rem, 5vw, 2.2rem);
    font-weight: 800;
    color: #fbbf24;
}

.stat-label {
    font-size: clamp(0.75rem, 2vw, 0.85rem);
    opacity: 0.85;
    margin-top: 4px;
}

.btn-primary {
    display: inline-block;
    background: #fff;
    color: var(--primary);
    padding: 12px 32px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    display: inline-block;
    background: var(--bg);
    color: var(--text);
    padding: 12px 28px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background: var(--border);
}

/* ===== 通用板块 ===== */
.section {
    padding: clamp(40px, 7vw, 70px) 0;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.section-alt {
    background: var(--bg-alt);
    backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
}

.section-title {
    font-size: clamp(1.3rem, 4vw, 1.8rem);
    font-weight: 800;
    text-align: center;
    margin-bottom: 12px;
    color: var(--text);
    background: linear-gradient(90deg, var(--primary), var(--primary-dark), var(--primary));
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-title::after {
    content: "";
    display: block;
    width: 50px;
    height: 3px;
    margin: 10px auto 0;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--primary), transparent);
}

.section-desc {
    text-align: center;
    color: var(--custom-text-color, var(--text-light));
    margin-bottom: clamp(24px, 4vw, 40px);
    font-size: clamp(0.8rem, 2vw, 0.95rem);
    opacity: 0.7;
    padding: 0 clamp(8px, 2vw, 16px);
}

/* ===== 技能树 ===== */
.skill-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
    gap: clamp(16px, 3vw, 28px);
}

.skill-category {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
}

.skill-category h3 {
    font-size: 1.15rem;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-light);
    color: var(--custom-text-color, var(--primary-dark));
}

.skill-item {
    padding: 12px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 8px;
    border: 1px solid transparent;
}

.skill-item:hover {
    background: var(--primary-light);
    border-color: var(--primary-light);
}

.skill-item-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.skill-item-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.skill-item-level {
    font-size: 0.8rem;
    color: var(--custom-text-color, var(--text-light));
    background: var(--bg);
    padding: 2px 8px;
    border-radius: 10px;
}

.progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #60a5fa);
    border-radius: 3px;
    transition: width 0.4s ease;
}

/* ===== 项目实战 ===== */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: clamp(16px, 3vw, 24px);
}

.project-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.project-icon {
    font-size: 2rem;
}

.project-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.project-status {
    font-size: 0.7rem;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.status-已完成 {
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
}

.status-进行中 {
    background: rgba(59, 130, 246, 0.15);
    color: #2563eb;
}

.status-规划中 {
    background: rgba(148, 163, 184, 0.2);
    color: #64748b;
}

.project-card h3 {
    font-size: 1.15rem;
    margin-bottom: 10px;
    color: var(--custom-text-color, var(--text));
}

.project-card p {
    color: var(--custom-text-color, var(--text-light));
    font-size: 0.9rem;
    margin-bottom: 14px;
    flex-grow: 1;
    opacity: 0.8;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.project-tag {
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 500;
}

.project-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}

.project-link:hover {
    text-decoration: underline;
}

/* ===== 学习资源 ===== */
.resource-tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.resource-tab {
    padding: 8px 20px;
    border-radius: 20px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-light);
    transition: all 0.3s var(--ease);
}

.resource-tab:hover:not(.active) {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 0 12px 1px rgba(37, 99, 235, 0.2);
}

.resource-tab.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 16px 2px rgba(37, 99, 235, 0.35);
}

.resource-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: clamp(12px, 2vw, 16px);
}

.resource-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    text-decoration: none;
    color: var(--text);
    transition: transform 0.2s, box-shadow 0.2s;
}

.resource-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
}

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

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

.resource-info h4 {
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.resource-info p {
    font-size: 0.8rem;
    color: var(--custom-text-color, var(--text-light));
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 0.7;
}

/* ===== 关于我 ===== */
.about-grid {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(300px, 1.4fr);
    gap: clamp(16px, 3vw, 28px);
    max-width: 100%;
}

.about-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: clamp(20px, 3vw, 30px);
    min-width: 0;
}

.about-card h3 {
    font-size: 1.1rem;
    margin-bottom: 14px;
    color: var(--custom-text-color, var(--primary-dark));
}

.about-card h3:not(:first-child) {
    margin-top: 22px;
}

.avatar {
    width: 80px;
    height: 80px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 16px;
    overflow: hidden;
    position: relative;
    border: 3px solid var(--primary-light);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* ===== 头像编辑器样式 ===== */
.avatar-editor-modal .modal-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.avatar-current {
    text-align: center;
    padding: 16px;
    background: var(--glass-bg);
    border-radius: 12px;
    border: 2px dashed var(--border);
}

.avatar-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 8px;
    overflow: hidden;
    border: 3px solid var(--primary);
    transition: all 0.3s ease;
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-hint {
    font-size: 12px;
    color: var(--text-secondary);
    opacity: 0.7;
}

.avatar-upload-section,
.avatar-emoji-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.avatar-upload-section label,
.avatar-emoji-section label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.avatar-upload-actions {
    display: flex;
    gap: 10px;
}

.avatar-emoji-section input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: var(--glass-bg);
    color: var(--text);
    font-size: 16px;
    transition: border-color 0.2s ease;
}

.avatar-emoji-section input:focus {
    outline: none;
    border-color: var(--primary);
}

.emoji-quick-pick {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.emoji-btn {
    width: 40px;
    height: 40px;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: var(--glass-bg);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.emoji-btn:hover {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.1);
    transform: scale(1.1);
}

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

/* 编辑模式下的头像样式 */
body.edit-mode .avatar {
    cursor: pointer;
    transition: all 0.2s ease;
}

body.edit-mode .avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3);
    border-color: var(--primary);
}

.avatar-edit-btn {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: 2px solid white;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s;
    z-index: 10;
}

.avatar:hover .avatar-edit-btn {
    opacity: 1;
}

/* 移动端头像编辑器适配 */
@media (max-width: 768px) {
    .avatar-preview {
        width: 80px;
        height: 80px;
        font-size: 2rem;
    }
    
    .avatar-upload-actions {
        flex-direction: row;
    }
    
    .emoji-btn {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
}

.about-card .avatar + h3 {
    text-align: center;
}

.about-role {
    text-align: center;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 14px;
    font-size: 0.9rem;
}

.about-desc {
    color: var(--custom-text-color, var(--text-light));
    font-size: 0.9rem;
    margin-bottom: 18px;
    opacity: 0.8;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--custom-text-color, var(--text-light));
    opacity: 0.75;
    flex-wrap: wrap;
}

.contact-item .contact-icon {
    flex-shrink: 0;
    font-size: 0.95rem;
}

.contact-item .contact-label {
    opacity: 0.8;
    white-space: nowrap;
}

.contact-item .contact-value {
    color: var(--text);
    word-break: break-all;
}

.contact-item .contact-value a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    word-break: break-all;
}

.contact-item .contact-value a:hover {
    text-decoration: underline;
}

.contact-item.editable {
    position: relative;
    padding: 6px 32px 6px 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.contact-item.editable:hover {
    background: rgba(245, 158, 11, 0.1);
    outline: 2px dashed rgba(245, 158, 11, 0.4);
}

.contact-item .contact-actions {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    gap: 4px;
}

.contact-item.editable:hover .contact-actions {
    display: flex;
}

.contact-item .contact-actions .item-btn {
    width: 24px;
    height: 24px;
    font-size: 11px;
    padding: 0;
    border-radius: 6px;
}

.add-contact-btn {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 8px 12px;
    border: 2px dashed var(--border);
    border-radius: 8px;
    background: var(--glass-bg);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.add-contact-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

/* ===== 证书图片样式 ===== */
.cert-item {
    position: relative;
}

.cert-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.cert-thumb {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
    background: var(--glass-bg);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.cert-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cert-thumb:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.cert-zoom {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 10px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cert-empty {
    font-size: 20px;
    color: var(--text-secondary);
    opacity: 0.5;
    cursor: default;
}

/* 编辑模式下证书缩略图 */
body.edit-mode .cert-thumb {
    cursor: pointer;
}

body.edit-mode .cert-thumb:hover {
    outline: 2px solid var(--primary);
}

/* 图片上传区域 */
.image-upload-field {
    margin-top: 16px;
}

.image-upload-area {
    width: 100%;
    min-height: 120px;
    border: 2px dashed var(--border);
    border-radius: 12px;
    background: var(--glass-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
    position: relative;
}

.image-upload-area:hover {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

.upload-placeholder {
    font-size: 14px;
    color: var(--text-secondary);
}

.upload-preview {
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
    border-radius: 8px;
}

.upload-success {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: #10b981;
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
}

.upload-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
    opacity: 0.7;
}

/* 图片上传操作按钮 */
.upload-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.upload-action-btn {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: var(--glass-bg);
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
}

.upload-action-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
    transform: translateY(-1px);
}

.upload-action-btn:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .upload-actions {
        flex-direction: row;
        gap: 8px;
    }
    
    .upload-action-btn {
        font-size: 12px;
        padding: 8px 10px;
    }
}

/* 图片预览弹窗 */
.image-preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20000;
    animation: fadeIn 0.2s ease;
}

.image-preview-modal {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.image-preview-close {
    position: absolute;
    top: -50px;
    right: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    z-index: 10;
}

.image-preview-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.image-preview-close:active {
    transform: scale(0.95);
}

.preview-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.image-preview-img {
    max-width: 90vw;
    max-height: 80vh;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    object-fit: contain;
}

.image-preview-caption {
    color: white;
    margin-top: 16px;
    font-size: 14px;
    opacity: 0.8;
    text-align: center;
}

/* 移动端证书图片适配 */
@media (max-width: 480px) {
    .cert-thumb {
        width: 40px;
        height: 40px;
    }

    .image-preview-close {
        top: -50px;
        right: 50%;
        transform: translateX(50%);
    }

    .image-preview-close:hover {
        transform: translateX(50%) scale(1.1);
    }
}

/* ===== 关于我卡片 - 编辑模式内联编辑 ===== */
body.edit-mode .editable-field {
    cursor: pointer !important;
    transition: all 0.2s ease;
    border-radius: 6px;
    padding: 2px 6px;
    margin: -2px -6px;
    position: relative;
}

body.edit-mode .editable-field:hover {
    background: rgba(245, 158, 11, 0.12);
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.3);
    transform: scale(1.02);
}

body.edit-mode .editable-field::after {
    content: " ✏️";
    opacity: 0;
    transition: opacity 0.2s;
    font-size: 0.8em;
}

body.edit-mode .editable-field:hover::after {
    opacity: 1;
}

body.edit-mode .about-card h3.editable-field,
body.edit-mode .about-card .about-role.editable-field {
    display: inline-block;
    margin-left: auto;
    margin-right: auto;
}

body.edit-mode .contact-info .editable-field {
    display: inline-block;
}

/* 头像编辑按钮 */
.avatar {
    position: relative;
}

.avatar-edit-btn {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: 2px solid white;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s;
    z-index: 10;
}

body.edit-mode .avatar:hover .avatar-edit-btn,
.avatar-edit-btn:hover {
    opacity: 1;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.5);
}

body.edit-mode .avatar {
    cursor: pointer;
    transition: all 0.2s;
}

body.edit-mode .avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.4);
}

.resume-list {
    list-style: none;
    padding: 0;
}

.resume-list li {
    padding: 8px 0 8px 20px;
    position: relative;
    font-size: 0.9rem;
    color: var(--custom-text-color, var(--text-light));
    border-bottom: 1px dashed var(--border);
    opacity: 0.8;
}

.resume-list li:last-child {
    border-bottom: none;
}

.resume-list li::before {
    content: "▸";
    position: absolute;
    left: 0;
    color: var(--primary);
}

/* ===== 编辑模式下的列表项 ===== */
.editable-list-item {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px !important;
    background: rgba(245, 158, 11, 0.08);
    border-radius: 8px;
    margin-bottom: 6px;
    border: 1px dashed rgba(245, 158, 11, 0.4);
}

.editable-list-item::before {
    display: none !important;
}

.editable-list-item .item-text {
    flex: 1;
    word-break: break-word;
    padding-right: 10px;
}

.editable-list-item .item-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.item-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.item-btn.edit-item-btn {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.item-btn.edit-item-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.item-btn.delete-item-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.item-btn.delete-item-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

.add-list-btn {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 10px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(16, 185, 129, 0.1));
    border: 2px dashed rgba(34, 197, 94, 0.5);
    border-radius: 8px;
    color: #10b981;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.add-list-btn:hover {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(16, 185, 129, 0.2));
    border-color: #10b981;
    transform: translateY(-1px);
}

/* ===== 导航栏按钮美化 ===== */
.nav-right .theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.nav-right .theme-toggle::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(139, 92, 246, 0.3));
    opacity: 0;
    transition: opacity 0.3s;
}

.nav-right .theme-toggle:hover {
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 0.5);
}

.nav-right .theme-toggle:hover::before {
    opacity: 1;
}

.nav-right .theme-toggle:active {
    transform: translateY(0) scale(0.95);
}

.nav-right .theme-toggle[aria-label="切换主题"] {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(245, 158, 11, 0.15));
    border-color: rgba(251, 191, 36, 0.3);
}

.nav-right .theme-toggle[aria-label="背景设置"] {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(168, 85, 247, 0.15));
    border-color: rgba(139, 92, 246, 0.3);
}

/* 编辑模式按钮特殊样式 */
.nav-right .edit-mode-btn {
    width: auto;
    min-width: 90px;
    padding: 0 16px;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(217, 119, 6, 0.15));
    border-color: rgba(245, 158, 11, 0.35);
    color: #f59e0b;
}

.nav-right .edit-mode-btn:hover {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(217, 119, 6, 0.25));
    border-color: #f59e0b;
    color: #fbbf24;
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.35);
}

.nav-right .edit-mode-btn.active {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    color: white !important;
    border-color: #f59e0b !important;
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.nav-right .edit-mode-btn .btn-icon {
    font-size: 1rem;
}

.nav-right .edit-mode-btn .btn-text {
    letter-spacing: 0.5px;
}

/* ===== 弹窗 ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--glass-bg, #fff);
    backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    border: 1px solid rgba(255, 255, 255, var(--glass-border-alpha));
    border-radius: var(--radius);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 1.15rem;
    color: var(--custom-text-color, var(--text));
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--text-light);
    cursor: pointer;
    line-height: 1;
}

.modal-body {
    padding: 24px;
}

.modal-body label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: var(--custom-text-color, var(--text));
}

.modal-body label:not(:first-child) {
    margin-top: 20px;
}

.progress-control {
    display: flex;
    align-items: center;
    gap: 14px;
}

.progress-control input[type="range"] {
    flex-grow: 1;
    accent-color: var(--primary);
}

.progress-control span {
    font-weight: 700;
    color: var(--primary);
    min-width: 45px;
    text-align: right;
}

#noteText {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
}

#noteText:focus {
    border-color: var(--primary);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

/* ===== 页脚 ===== */
.footer {
    background: rgba(30, 41, 59, var(--glass-bg-alpha, 0.9));
    backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    color: #cbd5e1;
    padding: clamp(20px, 4vw, 30px) 0;
    text-align: center;
    font-size: clamp(0.75rem, 2vw, 0.85rem);
    border-top: 1px solid rgba(255, 255, 255, var(--glass-border-alpha));
    width: 100%;
    box-sizing: border-box;
}

.footer-tip {
    margin-top: 6px;
    font-size: clamp(0.7rem, 1.8vw, 0.78rem);
    color: #64748b;
    padding: 0 clamp(8px, 2vw, 16px);
}

/* 暗黑模式:弹窗背景 */
body.dark .modal-content {
    background: var(--glass-bg, var(--bg-alt));
}

/* ===== 学习路线图 ===== */
.roadmap-timeline {
    position: relative;
    max-width: 760px;
    margin: 0 auto;
    padding-left: 40px;
}

.roadmap-timeline::before {
    content: "";
    position: absolute;
    left: 14px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: linear-gradient(180deg, var(--primary), var(--primary-light));
}

.roadmap-stage {
    position: relative;
    margin-bottom: 20px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    cursor: pointer;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.roadmap-stage:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.roadmap-stage::before {
    content: "";
    position: absolute;
    left: -33px;
    top: 22px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid var(--bg);
    box-shadow: 0 0 0 2px var(--primary);
}

.roadmap-stage-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.roadmap-stage-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
}

.roadmap-stage-title .stage-icon {
    margin-right: 6px;
}

.roadmap-stage-duration {
    font-size: 0.78rem;
    color: var(--primary);
    background: var(--primary-light);
    padding: 3px 10px;
    border-radius: 10px;
    font-weight: 600;
    white-space: nowrap;
}

.roadmap-stage-goal {
    font-size: 0.88rem;
    color: var(--custom-text-color, var(--text-light));
    margin-top: 6px;
    opacity: 0.8;
}

.roadmap-stage-detail {
    display: none;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed var(--border);
}

.roadmap-stage.expanded .roadmap-stage-detail {
    display: block;
}

.roadmap-stage-detail ul {
    list-style: none;
    padding: 0;
}

.roadmap-stage-detail li {
    padding: 5px 0 5px 18px;
    position: relative;
    font-size: 0.85rem;
    color: var(--custom-text-color, var(--text-light));
    opacity: 0.75;
}

.roadmap-stage-detail li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: 700;
}

/* ===== 面试题库 ===== */
.interview-tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.interview-tab {
    padding: 8px 20px;
    border-radius: 20px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-light);
    transition: all 0.3s var(--ease);
}

.interview-tab:hover:not(.active) {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 0 12px 1px rgba(37, 99, 235, 0.2);
}

.interview-tab.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 16px 2px rgba(37, 99, 235, 0.35);
}

.interview-list {
    max-width: 820px;
    margin: 0 auto;
}

.interview-item {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.interview-item:hover {
    border-color: var(--primary);
}

.interview-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
}

.interview-question .q-icon {
    flex-shrink: 0;
    color: var(--primary);
    font-weight: 700;
    transition: transform 0.2s;
}

.interview-item.expanded .q-icon {
    transform: rotate(90deg);
}

.interview-answer {
    display: none;
    padding: 0 20px 16px 44px;
    color: var(--custom-text-color, var(--text-light));
    font-size: 0.88rem;
    line-height: 1.7;
    white-space: pre-wrap;
    opacity: 0.8;
}

.interview-item.expanded .interview-answer {
    display: block;
}

/* ===== 返回顶部按钮 ===== */
.back-to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
    z-index: 90;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 0 20px 3px rgba(37, 99, 235, 0.4), var(--shadow-lg);
}

/* ===== 自定义背景层 ===== */
.bg-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    overflow: hidden;
}

.bg-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
    display: none;
}

.bg-layer.video-mode .bg-video {
    display: block;
}

.bg-layer.video-mode {
    background-image: none !important;
}

.bg-select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-alt);
    color: var(--text);
    font-size: 0.9rem;
    cursor: pointer;
    flex: 1;
    min-width: 160px;
}

.bg-select:focus {
    outline: none;
    border-color: var(--primary);
}

.bg-color-input {
    width: 40px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    background: var(--bg-alt);
    padding: 0;
}

.bg-color-input::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.bg-color-input::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

/* ===== 设置面板 Tab ===== */
.settings-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: var(--bg);
    border-radius: 10px;
    padding: 4px;
}

.settings-tab {
    flex: 1;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: var(--text-light);
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s var(--ease);
}

.settings-tab:hover {
    color: var(--text);
}

.settings-tab.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.tab-pane {
    display: none;
    animation: fadeIn 0.3s var(--ease);
}

.tab-pane.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 开启自定义背景时:板块半透明,让背景透出 */
body.has-custom-bg {
    background: transparent;
}

body.has-custom-bg {
    --bg: rgba(248, 250, 252, var(--glass-bg-alpha));
    --bg-alt: rgba(255, 255, 255, var(--glass-bg-alpha));
    --glass-bg: rgba(255, 255, 255, var(--glass-bg-alpha));
}

body.has-custom-bg.dark {
    --bg: rgba(15, 23, 42, var(--glass-bg-alpha));
    --bg-alt: rgba(30, 41, 59, var(--glass-bg-alpha));
    --glass-bg: rgba(30, 41, 59, var(--glass-bg-alpha));
}

/* ===== 背景设置弹窗 ===== */
.bg-presets {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 10px;
}

.bg-preset {
    height: 56px;
    border-radius: 8px;
    border: 2px solid var(--border);
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s;
    position: relative;
    overflow: hidden;
}

.bg-preset:hover {
    transform: translateY(-2px);
}

.bg-preset.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary);
}

.bg-preset .preset-label {
    position: absolute;
    bottom: 2px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.65rem;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
    line-height: 1;
}

.bg-upload-area {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.bg-tip {
    font-size: 0.78rem;
    color: var(--text-light);
    margin-top: 8px;
    line-height: 1.5;
}

/* ===== 高级 UI:液态玻璃 + 卡片鼓出 + 光泽扫过 ===== */
/* 滚动入场动画(放在悬浮规则前,保证悬浮优先级) */
.reveal {
    opacity: 0;
    transform: translateY(36px);
    transition: opacity 0.6s var(--ease), transform 0.6s var(--bounce);
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 通用玻璃容器类 */
.glass {
    background: var(--glass-bg, var(--bg-alt));
    backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    border: 1px solid rgba(255, 255, 255, var(--glass-border-alpha));
    border-radius: var(--radius);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        inset 0 -1px 0 rgba(0, 0, 0, 0.05),
        0 4px 16px rgba(0, 0, 0, 0.08);
}

/* 卡片液态玻璃质感 + 鼓出悬浮 */
.skill-category,
.project-card,
.about-card,
.resource-item,
.roadmap-stage,
.interview-item {
    position: relative;
    background: var(--glass-bg, var(--bg-alt));
    backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    border: 1px solid rgba(255, 255, 255, var(--glass-border-alpha));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        inset 0 -1px 0 rgba(0, 0, 0, 0.03),
        0 4px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.4s var(--bounce), box-shadow 0.4s var(--ease), border-color 0.3s var(--ease);
}

.skill-category:hover,
.project-card:hover,
.about-card:hover,
.resource-item:hover,
.roadmap-stage:hover,
.interview-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 -1px 0 rgba(0, 0, 0, 0.05),
        0 0 0 1px var(--primary),
        0 0 20px 2px rgba(37, 99, 235, 0.25),
        0 0 40px 4px rgba(37, 99, 235, 0.15),
        0 20px 50px -10px rgba(37, 99, 235, 0.4),
        0 10px 25px rgba(0, 0, 0, 0.12);
    border-color: var(--primary);
}

/* 非展开类卡片:光泽扫过(roadmap/interview 会展开,不加 overflow 与光泽) */
.skill-category,
.project-card,
.about-card,
.resource-item {
    overflow: hidden;
}

.skill-category::after,
.project-card::after,
.about-card::after,
.resource-item::after {
    content: "";
    position: absolute;
    top: 0;
    left: -130%;
    width: 60%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.35), rgba(37, 99, 235, 0.1), transparent);
    transform: skewX(-20deg);
    transition: left 0.7s var(--ease);
    pointer-events: none;
    z-index: 1;
}

.skill-category:hover::after,
.project-card:hover::after,
.about-card:hover::after,
.resource-item:hover::after {
    left: 140%;
}

/* 内容层级高于光泽 */
.project-card > *,
.about-card > *,
.resource-item > * {
    position: relative;
    z-index: 2;
}

/* 技能项横向微动 */
.skill-item {
    transition: background 0.2s, transform 0.25s var(--bounce);
}
.skill-item:hover {
    transform: translateX(6px);
}

/* 按钮辉光 */
.btn-primary {
    transition: transform 0.3s var(--bounce), box-shadow 0.3s var(--ease);
}
.btn-primary:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow:
        0 0 0 1px var(--primary),
        0 0 18px 2px rgba(37, 99, 235, 0.35),
        0 10px 26px rgba(0, 0, 0, 0.25);
}
.btn-secondary {
    transition: background 0.2s, transform 0.3s var(--bounce), box-shadow 0.3s var(--ease), border-color 0.2s;
}
.btn-secondary:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow:
        0 0 0 1px var(--primary),
        0 0 14px 2px rgba(37, 99, 235, 0.2),
        0 6px 18px rgba(37, 99, 235, 0.18);
}

/* 统计数字放大 */
.stat {
    transition: transform 0.3s var(--bounce), filter 0.3s var(--ease);
}
.stat:hover {
    transform: scale(1.15);
    filter: drop-shadow(0 0 12px rgba(251, 191, 36, 0.6));
}

/* 主题/设置按钮交互 */
.theme-toggle {
    transition: background 0.2s, transform 0.3s var(--bounce), box-shadow 0.3s;
}
.theme-toggle:hover {
    transform: rotate(20deg) scale(1.1);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

/* ===== 移动端响应式 ===== */

/* ----- 触摸设备全局适配 ----- */
/* 检测到触摸设备时,禁用 hover 粘滞,body 加 .touch-device 类 */
body.touch-device .skill-category:hover,
body.touch-device .project-card:hover,
body.touch-device .about-card:hover,
body.touch-device .resource-item:hover,
body.touch-device .roadmap-stage:hover,
body.touch-device .interview-item:hover,
body.touch-device .btn-primary:hover,
body.touch-device .btn-secondary:hover,
body.touch-device .resource-tab:hover:not(.active),
body.touch-device .interview-tab:hover:not(.active),
body.touch-device .stat:hover,
body.touch-device .theme-toggle:hover,
body.touch-device .back-to-top:hover,
body.touch-device .skill-item:hover,
body.touch-device .skill-category:hover::after,
body.touch-device .project-card:hover::after,
body.touch-device .about-card:hover::after,
body.touch-device .resource-item:hover::after {
    transform: none;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        inset 0 -1px 0 rgba(0, 0, 0, 0.03),
        0 4px 20px rgba(0, 0, 0, 0.08);
    border-color: rgba(255, 255, 255, var(--glass-border-alpha));
}

/* 触摸设备:用 .touch-active 类代替 hover,实现按压发光 */
body.touch-device .skill-category.touch-active,
body.touch-device .project-card.touch-active,
body.touch-device .about-card.touch-active,
body.touch-device .resource-item.touch-active,
body.touch-device .roadmap-stage.touch-active,
body.touch-device .interview-item.touch-active {
    transform: scale(0.97);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 -1px 0 rgba(0, 0, 0, 0.05),
        0 0 0 2px var(--primary),
        0 0 24px 3px rgba(37, 99, 235, 0.35),
        0 0 48px 6px rgba(37, 99, 235, 0.2),
        0 8px 30px rgba(0, 0, 0, 0.15);
    border-color: var(--primary);
    transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease), border-color 0.15s var(--ease);
}

/* 触摸设备:按钮按压发光 */
body.touch-device .btn-primary.touch-active {
    transform: scale(0.95);
    box-shadow:
        0 0 0 2px var(--primary),
        0 0 20px 3px rgba(37, 99, 235, 0.4),
        0 4px 16px rgba(0, 0, 0, 0.2);
}

body.touch-device .btn-secondary.touch-active {
    transform: scale(0.95);
    border-color: var(--primary);
    box-shadow:
        0 0 0 2px var(--primary),
        0 0 16px 2px rgba(37, 99, 235, 0.25);
}

/* 触摸设备:标签按压发光 */
body.touch-device .resource-tab.touch-active:not(.active),
body.touch-device .interview-tab.touch-active:not(.active) {
    transform: scale(0.94);
    border-color: var(--primary);
    box-shadow: 0 0 14px 2px rgba(37, 99, 235, 0.25);
}

body.touch-device .resource-tab.touch-active.active,
body.touch-device .interview-tab.touch-active.active {
    transform: scale(0.94);
    box-shadow: 0 0 20px 3px rgba(37, 99, 235, 0.4);
}

/* 触摸设备:技能项按压 */
body.touch-device .skill-item.touch-active {
    transform: translateX(4px);
    background: var(--primary-light);
    border-color: var(--primary-light);
}

/* 触摸设备:统计数字按压发光 */
body.touch-device .stat.touch-active {
    transform: scale(1.1);
    filter: drop-shadow(0 0 14px rgba(251, 191, 36, 0.6));
}

/* 触摸设备:主题/设置按钮按压 */
body.touch-device .theme-toggle.touch-active {
    transform: scale(0.9);
    box-shadow: 0 0 12px 2px rgba(37, 99, 235, 0.3);
}

/* 触摸设备:返回顶部按压 */
body.touch-device .back-to-top.touch-active {
    transform: translateY(-2px) scale(0.92);
    box-shadow: 0 0 22px 4px rgba(37, 99, 235, 0.45), var(--shadow-lg);
}

/* 触摸设备:光泽扫过动画(touch-active 时触发一次) */
body.touch-device .skill-category.touch-active::after,
body.touch-device .project-card.touch-active::after,
body.touch-device .about-card.touch-active::after,
body.touch-device .resource-item.touch-active::after {
    left: 140%;
}

/* 移除触摸设备默认点击高亮 */
@media (max-width: 768px) {
    * {
        -webkit-tap-highlight-color: transparent;
    }

    .menu-toggle {
        display: flex;
    }

    .nav-menu {
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--bg-alt);
        flex-direction: column;
        gap: 0;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s;
        border-bottom: 1px solid var(--border);
        z-index: 99;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    }

    .nav-menu.active {
        max-height: 420px;
    }

    .nav-menu a {
        padding: 14px 20px;
        border-bottom: 1px solid var(--border);
        font-size: clamp(0.85rem, 3.5vw, 1rem);
    }

    .skill-categories {
        grid-template-columns: 1fr;
    }

    .project-grid {
        grid-template-columns: 1fr;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }

    .resource-list {
        grid-template-columns: 1fr;
    }

    .resource-tabs {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
    }

    .resource-tab {
        white-space: nowrap;
    }

    .interview-tabs {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
    }

    .interview-tab {
        white-space: nowrap;
    }

    .roadmap-timeline {
        padding-left: 30px;
    }

    .roadmap-stage::before {
        left: -23px;
    }

    .back-to-top {
        right: 16px;
        bottom: 16px;
        width: 40px;
        height: 40px;
    }
}

// ===== Toast 动画 =====
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

// ===== 数据备份标签页样式 =====
.backup-section {
    padding: 20px 0;
}

.backup-section h4 {
    margin: 0 0 12px;
    font-size: 15px;
    color: var(--text);
}

.backup-section p {
    margin: 0 0 16px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.backup-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.backup-btn {
    flex: 1;
    min-width: 120px;
    padding: 12px 20px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    color: var(--text);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.backup-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.2);
    border-color: var(--primary);
}

.backup-btn.primary {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: white;
    border-color: transparent;
}

.backup-btn.primary:hover {
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4);
}

.backup-tips {
    margin-top: 16px;
    padding: 12px;
    background: rgba(37, 99, 235, 0.08);
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.backup-tips strong {
    color: var(--primary);
}

// ===== 编辑模式样式 =====
.edit-mode-btn {
    font-size: 12px !important;
    padding: 6px 10px !important;
}

.edit-mode-btn.active {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    color: white !important;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
}

body.edit-mode .project-card,
body.edit-mode .skill-category,
body.edit-mode .roadmap-stage,
body.edit-mode .interview-item,
body.edit-mode .resource-item,
body.edit-mode .about-card {
    position: relative;
    outline: 2px dashed rgba(245, 158, 11, 0.5);
    outline-offset: 2px;
}

body.edit-mode .project-card::before,
body.edit-mode .skill-category::before,
body.edit-mode .roadmap-stage::before,
body.edit-mode .interview-item::before,
body.edit-mode .resource-item::before,
body.edit-mode .about-card::before {
    content: "可编辑";
    position: absolute;
    top: -10px;
    left: 10px;
    background: #f59e0b;
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    z-index: 10;
}

.edit-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: #f59e0b;
    color: white;
    font-size: 14px;
    cursor: pointer;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.edit-mode .project-card:hover .edit-btn,
body.edit-mode .skill-category:hover .edit-btn,
body.edit-mode .roadmap-stage:hover .edit-btn,
body.edit-mode .interview-item:hover .edit-btn,
body.edit-mode .resource-item:hover .edit-btn,
body.edit-mode .about-card:hover .edit-btn {
    opacity: 1;
}

.edit-btn:hover {
    transform: scale(1.2);
    background: #d97706;
}

.edit-btn.add-btn {
    position: static;
    width: auto;
    height: auto;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    opacity: 1;
    margin: 20px auto;
    display: block;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
}

.edit-btn.add-btn:hover {
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
}

// ===== 编辑弹窗样式 =====
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-footer .btn-secondary {
    padding: 8px 20px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
}

.modal-footer .btn-primary {
    padding: 8px 20px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: white;
    cursor: pointer;
}

.modal-footer .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
}

.edit-field {
    margin-bottom: 16px;
}

.edit-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.edit-field input[type="text"],
.edit-field textarea,
.edit-field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--glass-bg);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
}

.edit-field input[type="text"]:focus,
.edit-field textarea:focus,
.edit-field select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.edit-field textarea {
    resize: vertical;
    min-height: 80px;
}

.edit-field ul {
    list-style: none;
    padding: 0;
    margin: 0 0 8px;
}

.edit-field ul li {
    padding: 8px 12px;
    margin-bottom: 6px;
    background: var(--glass-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: text;
    font-size: 14px;
}

.edit-field ul li:focus {
    outline: 2px solid var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

.edit-add-item {
    padding: 6px 12px;
    border: 1px dashed var(--border);
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    width: 100%;
}

.edit-add-item:hover {
    border-color: var(--primary);
    color: var(--primary);
}

// ===== 版本徽章 =====
.version-badge {
    display: inline-block;
    padding: 2px 8px;
    margin-left: 8px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

// ===== 编辑模式下的 about section =====
#about {
    position: relative;
}

// ===== 自动更新弹窗 =====
.update-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.update-modal {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 40px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.update-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    animation: bounce 2s infinite;
}

.update-modal h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 20px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.update-content {
    text-align: left;
    margin-bottom: 28px;
}

.update-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 16px;
    line-height: 1.6;
}

.update-changelog {
    background: var(--glass-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 18px;
    font-size: 13px;
}

.update-changelog strong {
    display: block;
    margin-bottom: 8px;
    color: var(--primary);
}

.update-changelog ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.update-changelog li {
    padding: 4px 0;
    color: var(--text-secondary);
    position: relative;
    padding-left: 16px;
}

.update-changelog li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: 700;
}

.update-actions {
    display: flex;
    gap: 12px;
}

.update-btn {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.update-later {
    background: var(--glass-bg);
    color: var(--text);
    border: 1px solid var(--border);
}

.update-later:hover {
    background: var(--border);
}

.update-now {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.update-now:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

// 移动端更新弹窗适配
@media (max-width: 480px) {
    .update-modal {
        padding: 28px 24px;
        border-radius: 16px;
    }

    .update-icon {
        font-size: 3rem;
    }

    .update-modal h2 {
        font-size: 1.2rem;
    }

    .update-actions {
        flex-direction: column-reverse;
    }

    .update-btn {
        padding: 12px 16px;
        font-size: 14px;
    }
}

// ===== 离线提示横幅 =====
.offline-banner {
    position: fixed;
    top: 60px;
    left: 12px;
    right: 12px;
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: white;
    padding: 12px 16px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    z-index: 9999;
    box-shadow: 0 4px 20px rgba(249, 115, 22, 0.4);
    animation: slideDown 0.3s ease;
    backdrop-filter: blur(10px);
}

.offline-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}

.offline-icon {
    font-size: 1.3rem;
    animation: pulse 2s infinite;
}

.offline-text {
    font-size: 14px;
    font-weight: 600;
}

.offline-sub {
    font-size: 12px;
    opacity: 0.85;
    width: 100%;
    margin-left: 34px;
}

.offline-retry {
    padding: 8px 16px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.offline-retry:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.05);
}

.offline-retry:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

// 暗黑模式下离线横幅优化
body.dark-mode .offline-banner {
    background: linear-gradient(135deg, #ea580c, #c2410c);
    box-shadow: 0 4px 20px rgba(234, 88, 12, 0.3);
}

// 移动端离线横幅适配
@media (max-width: 480px) {
    .offline-banner {
        top: 54px;
        left: 8px;
        right: 8px;
        padding: 10px 12px;
        border-radius: 10px;
        flex-direction: column;
        align-items: stretch;
    }

    .offline-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .offline-sub {
        margin-left: 0;
    }

    .offline-retry {
        width: 100%;
        margin-top: 8px;
        padding: 10px;
    }
}

/* ===== 全局响应式优化 ===== */

/* 平板适配 (768px - 1024px) */
@media (max-width: 1024px) {
    .about-grid {
        gap: clamp(16px, 3vw, 20px);
    }
    
    .about-card {
        padding: clamp(18px, 3vw, 24px);
    }
}

/* 手机适配 (max-width: 768px) */
@media (max-width: 768px) {
    * {
        -webkit-tap-highlight-color: transparent;
    }
    
    html {
        font-size: 100%; /* 使用根字体大小，由 clamp 控制 */
    }
    
    body {
        font-size: var(--base-font-size);
        overflow-x: hidden;
    }
    
    /* 导航栏 */
    .menu-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--bg-alt);
        flex-direction: column;
        gap: 0;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s;
        border-bottom: 1px solid var(--border);
        z-index: 99;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    }
    
    .nav-menu.active {
        max-height: 420px;
    }
    
    .nav-menu a {
        padding: 14px 20px;
        border-bottom: 1px solid var(--border);
        font-size: clamp(0.85rem, 3.5vw, 1rem);
    }
    
    /* 关于我卡片 */
    .about-grid {
        gap: clamp(12px, 3vw, 16px);
    }
    
    .about-card {
        padding: clamp(16px, 4vw, 20px);
        border-radius: var(--radius);
    }
    
    /* 联系方式 */
    .contact-info {
        gap: 8px;
    }
    
    .contact-item {
        font-size: clamp(0.75rem, 2.5vw, 0.8rem);
        flex-wrap: wrap;
    }
    
    .contact-item .contact-value {
        word-break: break-all;
    }
    
    /* 列表样式 */
    .resume-list li {
        padding: clamp(8px, 2vw, 10px) clamp(10px, 2.5vw, 12px);
        font-size: clamp(0.8rem, 2.5vw, 0.85rem);
        flex-wrap: wrap;
        gap: 4px;
    }
    
    /* 证书区域 */
    .cert-content {
        gap: 8px;
    }
    
    .cert-thumb {
        width: clamp(40px, 12vw, 44px);
        height: clamp(40px, 12vw, 44px);
    }
    
    .cert-item .item-text {
        flex: 1;
        min-width: 0;
        word-break: break-word;
    }
    
    /* 标签页 */
    .resource-tabs,
    .interview-tabs {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    
    .resource-tab,
    .interview-tab {
        white-space: nowrap;
        font-size: clamp(0.8rem, 2.5vw, 0.85rem);
        padding: 8px 14px;
    }
    
    /* 时间线 */
    .roadmap-timeline {
        padding-left: 28px;
    }
    
    .roadmap-stage::before {
        left: -22px;
        width: 18px;
        height: 18px;
        font-size: 10px;
    }
    
    .roadmap-content {
        padding: clamp(12px, 3vw, 14px);
    }
    
    /* 图片上传区域 */
    .image-upload-area {
        min-height: 100px;
        padding: 16px;
    }
    
    .upload-preview {
        max-height: 150px;
    }
    
    /* 编辑弹窗 */
    .modal {
        width: 95%;
        max-height: 90vh;
        margin: 10px auto;
    }
    
    .modal-content {
        padding: 20px 16px;
    }
    
    .modal-header {
        padding-bottom: 12px;
        margin-bottom: 14px;
    }
    
    .modal-header h3 {
        font-size: clamp(1rem, 3.5vw, 1.1rem);
    }
    
    .modal-body {
        gap: 12px;
    }
    
    .edit-field label {
        font-size: clamp(0.8rem, 2.5vw, 0.85rem);
    }
    
    .edit-field input,
    .edit-field textarea,
    .edit-field select {
        font-size: 16px; /* 防止 iOS 自动缩放 */
        padding: 10px 12px;
    }
    
    .modal-actions {
        padding-top: 14px;
        gap: 10px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: clamp(0.85rem, 2.5vw, 0.9rem);
        min-height: 44px;
    }
    
    /* 列表项操作按钮 */
    .item-actions {
        gap: 6px;
    }
    
    .item-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .contact-item .contact-actions .item-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    /* 返回顶部按钮 */
    .back-to-top {
        right: 16px;
        bottom: 16px;
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
    
    /* Toast 提示 */
    .toast {
        font-size: 14px;
        padding: 10px 16px;
        max-width: 90vw;
    }
    
    /* 更新弹窗 */
    .update-modal {
        width: 92%;
        padding: 24px 20px;
        border-radius: 14px;
    }
    
    .update-icon {
        font-size: 3rem;
    }
    
    .update-modal h2 {
        font-size: 1.15rem;
    }
    
    .update-changelog {
        font-size: 0.8rem;
    }
    
    .update-actions {
        flex-direction: column-reverse;
        gap: 10px;
    }
    
    .update-btn {
        width: 100%;
        padding: 12px 16px;
        font-size: 14px;
    }
    
    /* 离线横幅 */
    .offline-banner {
        top: 54px;
        left: 8px;
        right: 8px;
        padding: 10px 12px;
        border-radius: 10px;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .offline-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .offline-sub {
        margin-left: 0;
    }
    
    .offline-retry {
        width: 100%;
        margin-top: 4px;
        padding: 10px;
    }
    
    /* 图片预览 */
    .image-preview-modal {
        max-width: 95vw;
    }
    
    .image-preview-close {
        top: -44px;
        right: 50%;
        transform: translateX(50%);
        width: 44px;
        height: 44px;
    }
    
    .image-preview-close:hover {
        transform: translateX(50%) scale(1.1);
    }
    
    .image-preview-img {
        max-height: 75vh;
        border-radius: 8px;
    }
    
    /* 添加按钮 */
    .add-list-btn,
    .add-contact-btn {
        padding: 10px;
        font-size: clamp(0.8rem, 2.5vw, 0.85rem);
        min-height: 44px;
    }
}

/* 小屏幕手机 (max-width: 380px) */
@media (max-width: 380px) {
    .about-card {
        padding: 16px 12px;
    }
    
    .cert-thumb {
        width: 40px;
        height: 40px;
    }
    
    .edit-field input,
    .edit-field textarea,
    .edit-field select {
        font-size: 16px;
        padding: 10px;
    }
}

/* 横屏适配 (max-height: 500px) */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        padding: 30px 16px;
    }
    
    .hero h1 {
        font-size: 1.3rem;
    }
    
    .hero-stats {
        margin-top: 20px;
        gap: 20px;
    }
    
    .stat-num {
        font-size: 1.5rem;
    }
    
    .section {
        padding: 30px 0;
    }
    
    .modal {
        max-height: 95vh;
    }
    
    .image-preview-img {
        max-height: 85vh;
    }
}
