/* ============================================
   Life RPG｜人生升级系统 - 样式文件
   设计风格：RPG游戏界面 + Notion现代风格
   ============================================ */

/* ========== 基础变量与重置 ========== */
:root {
    /* 深色科技感配色 */
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: #1a2235;
    --bg-card-hover: #222d45;
    --bg-modal: #141b2e;
    --bg-input: #0d1526;
    --bg-sidebar: #0d1220;

    /* 强调色 */
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-gold: #f59e0b;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-blue: #3b82f6;
    --accent-cyan: #06b6d4;
    --accent-pink: #ec4899;

    /* 文字颜色 */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* 边框与阴影 */
    --border-color: #2a3550;
    --border-glow: rgba(99, 102, 241, 0.3);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px var(--border-glow);

    /* 渐变 */
    --gradient-exp: linear-gradient(90deg, #6366f1, #8b5cf6, #a855f7);
    --gradient-gold: linear-gradient(90deg, #f59e0b, #f97316);
    --gradient-green: linear-gradient(90deg, #10b981, #059669);
    --gradient-red: linear-gradient(90deg, #ef4444, #dc2626);

    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    /* 侧边栏宽度 */
    --sidebar-width: 220px;
    --sidebar-collapsed: 70px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ========== 布局容器 ========== */
.app-container {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 24px;
    max-width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
}

/* ========== 侧边栏 ========== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: width 0.3s ease;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 16px;
    border-bottom: 1px solid var(--border-color);
}

.logo-icon {
    font-size: 1.8rem;
}

.logo-text {
    font-size: 1.2rem;
    font-weight: 700;
    background: var(--gradient-exp);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}

.nav-menu {
    list-style: none;
    flex: 1;
    padding: 12px 8px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    margin-bottom: 4px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.nav-item:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.15));
    color: var(--accent-primary);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.nav-icon {
    font-size: 1.2rem;
    min-width: 24px;
    text-align: center;
}

.nav-text {
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

/* ========== 按钮 ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-primary);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
}

.btn-small {
    padding: 6px 14px;
    font-size: 0.8rem;
}

.btn-attr {
    margin-top: 10px;
    width: 100%;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--accent-primary);
}

.btn-attr:hover {
    background: rgba(99, 102, 241, 0.3);
}

.btn-danger {
    background: var(--accent-red);
}

.btn-result {
    flex: 1;
    padding: 12px;
    font-size: 1rem;
    border: 2px solid transparent;
}

.btn-result.victory {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--accent-green);
    color: var(--accent-green);
}

.btn-result.victory:hover,
.btn-result.victory.selected {
    background: rgba(16, 185, 129, 0.35);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

.btn-result.defeat {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--accent-red);
    color: var(--accent-red);
}

.btn-result.defeat:hover,
.btn-result.defeat.selected {
    background: rgba(239, 68, 68, 0.35);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.3);
}

/* ========== 页面 ========== */
.page {
    display: none;
    animation: fadeIn 0.4s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

/* ========== 卡片 ========== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-card);
    transition: all 0.3s ease;
}

.card:hover {
    border-color: rgba(99, 102, 241, 0.3);
}

/* ========== 角色卡片 ========== */
.character-card {
    margin-bottom: 24px;
    background: linear-gradient(135deg, var(--bg-card), rgba(99, 102, 241, 0.08));
}

.character-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.character-avatar {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(139, 92, 246, 0.2));
    border: 2px solid var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    box-shadow: var(--shadow-glow);
    flex-shrink: 0;
}

.character-info {
    flex: 1;
    min-width: 150px;
}

.character-info h2 {
    font-size: 1.4rem;
    margin-bottom: 6px;
}

.level-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--gradient-gold);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.95rem;
    color: #000;
}

.character-title {
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: 6px 14px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: var(--radius-full);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.exp-section {
    margin-top: 8px;
}

.exp-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.exp-bar {
    width: 100%;
    height: 14px;
    background: var(--bg-input);
    border-radius: var(--radius-full);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.exp-fill {
    height: 100%;
    background: var(--gradient-exp);
    border-radius: var(--radius-full);
    transition: width 0.8s ease;
    position: relative;
    overflow: hidden;
}

.exp-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* ========== 属性面板 ========== */
.attributes-section {
    margin-bottom: 24px;
}

.attributes-section h3 {
    margin-bottom: 16px;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.attributes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.attribute-card {
    text-align: center;
    position: relative;
    overflow: hidden;
}

.attribute-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-exp);
}

.attr-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 6px;
}

.attr-icon {
    font-size: 1.5rem;
}

.attr-name {
    font-weight: 700;
    font-size: 1rem;
}

.attr-desc {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 12px;
}

.attr-level {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent-gold);
    margin-bottom: 8px;
}

.attr-exp-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-input);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 6px;
}

.attr-exp-fill {
    height: 100%;
    background: var(--gradient-exp);
    border-radius: var(--radius-full);
    transition: width 0.6s ease;
}

.attr-exp-text {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ========== 升级历史 ========== */
.level-history {
    margin-top: 24px;
}

.level-history h3 {
    margin-bottom: 16px;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.history-item .history-level {
    color: var(--accent-gold);
    font-weight: 700;
}

.history-item .history-date {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.history-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 30px;
    font-size: 0.9rem;
}

/* ========== 任务系统 ========== */
.quest-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 10px 24px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.tab-btn.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.15));
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.quest-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quest-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.quest-item:hover {
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateX(4px);
}

.quest-item.completed {
    opacity: 0.6;
    border-color: var(--accent-green);
}

.quest-item.completed .quest-name {
    text-decoration: line-through;
}

.quest-checkbox {
    width: 28px;
    height: 28px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.quest-checkbox:hover {
    border-color: var(--accent-green);
}

.quest-checkbox.checked {
    background: var(--accent-green);
    border-color: var(--accent-green);
    color: white;
}

.quest-info {
    flex: 1;
    min-width: 0;
}

.quest-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 4px;
}

.quest-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 0.8rem;
}

.quest-exp {
    color: var(--accent-gold);
}

.quest-attr-tag {
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-primary);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.quest-type-tag {
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
}

.quest-type-tag.main {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-gold);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.quest-type-tag.side {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.quest-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.quest-complete-btn {
    padding: 8px 16px;
    background: var(--gradient-green);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.quest-complete-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.quest-delete-btn {
    padding: 8px 12px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.quest-delete-btn:hover {
    border-color: var(--accent-red);
    color: var(--accent-red);
}

.quest-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.quest-empty .empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

/* ========== 技能树 ========== */
.skill-trees-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.skill-tree {
    position: relative;
}

.tree-title {
    margin-bottom: 20px;
    font-size: 1.1rem;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.tree-branches {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.skill-node {
    padding: 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.skill-node:hover {
    border-color: var(--accent-primary);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.skill-node.maxed {
    border-color: var(--accent-gold);
    background: rgba(245, 158, 11, 0.05);
}

.skill-node-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.skill-node-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 6px;
}

.skill-node-level {
    font-size: 0.85rem;
    color: var(--accent-gold);
    margin-bottom: 8px;
}

.skill-node-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-primary);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 8px;
}

.skill-node-bar-fill {
    height: 100%;
    background: var(--gradient-gold);
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

.skill-node-btn {
    padding: 6px 14px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-sm);
    color: var(--accent-primary);
    font-family: inherit;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.skill-node-btn:hover {
    background: rgba(99, 102, 241, 0.3);
}

.skill-node-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ========== Boss挑战 ========== */
.boss-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.boss-item {
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.boss-item:hover {
    border-color: rgba(239, 68, 68, 0.3);
}

.boss-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.boss-name {
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.boss-name::before {
    content: '👹';
    font-size: 1.3rem;
}

.boss-difficulty {
    display: flex;
    gap: 2px;
}

.boss-difficulty .star {
    font-size: 1rem;
}

.boss-solution {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 12px;
    padding: 10px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent-primary);
}

.boss-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.boss-result {
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
}

.boss-result.victory {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.boss-result.defeat {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.boss-date {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.boss-exp {
    color: var(--accent-gold);
    font-weight: 600;
}

.difficulty-selector {
    display: flex;
    gap: 8px;
}

.difficulty-selector .star {
    font-size: 1.8rem;
    cursor: pointer;
    opacity: 0.3;
    transition: all 0.2s ease;
}

.difficulty-selector .star:hover,
.difficulty-selector .star.active {
    opacity: 1;
    transform: scale(1.2);
}

.battle-result {
    display: flex;
    gap: 12px;
}

.boss-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.boss-empty .empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

/* ========== 每日复盘 ========== */
.review-form {
    margin-bottom: 24px;
}

.review-form h3 {
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.review-history {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.review-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.review-item:hover {
    border-color: rgba(99, 102, 241, 0.3);
}

.review-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.review-item-date {
    font-weight: 700;
    font-size: 1rem;
    color: var(--accent-primary);
}

.review-item-body {
    display: none;
    margin-top: 12px;
}

.review-item.expanded .review-item-body {
    display: block;
}

.review-item-body .review-section {
    margin-bottom: 12px;
}

.review-section-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.review-section-content {
    color: var(--text-primary);
    font-size: 0.9rem;
    padding: 8px 12px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
}

.review-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.review-empty .empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

/* ========== 数据统计 ========== */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    text-align: center;
    padding: 24px 16px;
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 4px;
    background: var(--gradient-exp);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.charts-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 16px;
}

.chart-card {
    padding: 20px;
}

.chart-card h3 {
    margin-bottom: 16px;
    font-size: 1rem;
    color: var(--text-secondary);
}

.chart-card canvas {
    width: 100% !important;
    max-height: 300px;
}

/* ========== 成就系统 ========== */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.achievement-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.achievement-card.unlocked {
    border-color: var(--accent-gold);
    background: linear-gradient(135deg, var(--bg-card), rgba(245, 158, 11, 0.05));
}

.achievement-card.unlocked:hover {
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.15);
}

.achievement-card.locked {
    opacity: 0.5;
}

.achievement-card-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.achievement-card.unlocked .achievement-card-icon {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
}

.achievement-card-info {
    flex: 1;
    min-width: 0;
}

.achievement-card-name {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.achievement-card.unlocked .achievement-card-name {
    color: var(--accent-gold);
}

.achievement-card-desc {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 6px;
}

.achievement-card-progress {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.achievement-card-date {
    font-size: 0.7rem;
    color: var(--accent-gold);
}

/* ========== 模态框 ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.show {
    display: flex;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--bg-modal);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideUp 0.3s ease;
}

@keyframes modalSlideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.1rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

/* ========== 表单 ========== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    transition: border-color 0.2s ease;
    margin-bottom: 8px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.form-group select {
    cursor: pointer;
}

.form-group select option {
    background: var(--bg-modal);
    color: var(--text-primary);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}

/* 头像选择 */
.avatar-options {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.avatar-option {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    cursor: pointer;
    border: 2px solid var(--border-color);
    background: var(--bg-input);
    transition: all 0.2s ease;
}

.avatar-option:hover {
    border-color: var(--accent-primary);
    transform: scale(1.1);
}

.avatar-option.selected {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.15);
    box-shadow: var(--shadow-glow);
}

/* ========== 升级弹窗 ========== */
.level-up-modal .modal-content {
    text-align: center;
    padding: 40px;
    background: linear-gradient(135deg, var(--bg-modal), rgba(99, 102, 241, 0.1));
}

.level-up-animation {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 24px;
}

.level-up-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.4), transparent);
    animation: pulseGlow 1.5s ease infinite;
}

@keyframes pulseGlow {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.3); opacity: 0.2; }
}

.level-up-icon {
    position: relative;
    font-size: 4rem;
    animation: bounceIcon 0.6s ease;
}

@keyframes bounceIcon {
    0% { transform: scale(0); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.level-up-title {
    font-size: 1.5rem;
    margin-bottom: 12px;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.level-up-info {
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.level-up-bonus {
    padding: 16px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
}

.bonus-title {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--accent-gold);
}

.bonus-item {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ========== 成就解锁弹窗 ========== */
.achievement-modal .modal-content {
    text-align: center;
    padding: 40px;
    background: linear-gradient(135deg, var(--bg-modal), rgba(245, 158, 11, 0.08));
}

.achievement-unlock-animation {
    margin-bottom: 24px;
}

.achievement-icon {
    font-size: 4rem;
    animation: trophySpin 0.8s ease;
}

@keyframes trophySpin {
    0% { transform: scale(0) rotate(-180deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.achievement-info {
    margin-bottom: 24px;
}

.achievement-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent-gold);
    margin-bottom: 8px;
}

.achievement-desc {
    color: var(--text-secondary);
}

/* ========== 滚动条 ========== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* ========== 响应式设计 ========== */
@media (max-width: 1024px) {
    .attributes-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .charts-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 70px;
    }

    .sidebar {
        width: var(--sidebar-collapsed);
    }

    .logo-text,
    .nav-text {
        display: none;
    }

    .logo {
        justify-content: center;
        padding: 16px 8px;
    }

    .nav-item {
        justify-content: center;
        padding: 14px;
    }

    .sidebar-footer {
        padding: 8px;
    }

    .sidebar-footer .btn {
        width: 100%;
        padding: 10px;
        font-size: 0.7rem;
    }

    .main-content {
        margin-left: var(--sidebar-collapsed);
        max-width: calc(100% - var(--sidebar-collapsed));
        padding: 16px;
    }

    .page-header h1 {
        font-size: 1.2rem;
    }

    .character-header {
        gap: 12px;
    }

    .character-avatar {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }

    .attributes-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .tree-branches {
        grid-template-columns: 1fr;
    }

    .quest-item {
        flex-wrap: wrap;
        padding: 14px;
    }

    .quest-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .modal-content {
        max-width: 100%;
    }

    .stats-overview {
        grid-template-columns: repeat(2, 1fr);
    }

    .achievements-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 12px;
    }

    .attributes-grid {
        grid-template-columns: 1fr;
    }

    .stats-overview {
        grid-template-columns: 1fr;
    }

    .character-header {
        flex-direction: column;
        text-align: center;
    }

    .quest-tabs {
        flex-direction: column;
    }

    .battle-result {
        flex-direction: column;
    }
}