/* ============================================
   封神与哪吒 - 天赋系统 & 每日福利
   talent_daily.html 专用
   ============================================ */

/* ============================================
   通用页面容器 & 标题栏
   ============================================ */
.td-page {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--color-bg);
}

/* 宣纸纹理叠加 */
.td-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(44, 44, 44, 0.008) 2px,
            rgba(44, 44, 44, 0.008) 3px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 4px,
            rgba(44, 44, 44, 0.005) 4px,
            rgba(44, 44, 44, 0.005) 5px
        );
    pointer-events: none;
    z-index: 0;
}

.td-page > * {
    position: relative;
    z-index: 1;
}

/* 顶部标题栏 */
.td-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
    border-bottom: 1px solid rgba(212, 168, 83, 0.25);
    background: linear-gradient(
        180deg,
        rgba(245, 239, 224, 0.95) 0%,
        rgba(245, 239, 224, 0.6) 100%
    );
    animation: fadeInDown 0.4s ease both;
}

.td-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 返回按钮 */
.btn-back {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--color-ink);
    background: linear-gradient(
        180deg,
        rgba(245, 239, 224, 0.95) 0%,
        rgba(232, 224, 204, 0.9) 100%
    );
    border: 1.5px solid var(--color-gold-dark);
    box-shadow: var(--shadow-ink);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-back:hover {
    border-color: var(--color-gold);
    box-shadow: var(--shadow-gold);
    transform: translateX(-2px);
}

.btn-back:active {
    transform: scale(0.92);
}

/* 标题文字 */
.td-title {
    font-family: var(--font-title);
    font-size: 1.25rem;
    color: var(--color-ink);
    letter-spacing: 0.1em;
}

/* 顶部资源（功德）显示 */
.td-merit {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    background: linear-gradient(
        135deg,
        rgba(212, 168, 83, 0.15) 0%,
        rgba(212, 168, 83, 0.08) 100%
    );
    border: 1px solid rgba(212, 168, 83, 0.35);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-ink);
}

.td-merit-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #e8c97a 0%, #b08a3a 100%);
    box-shadow: 0 1px 3px rgba(176, 138, 58, 0.4);
}

.td-merit-value {
    font-variant-numeric: tabular-nums;
    color: var(--color-gold-dark);
    font-weight: 700;
    animation: shimmer 3s ease-in-out infinite;
}

/* 视图切换容器 */
.td-view {
    display: none;
    flex: 1;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.td-view.is-active {
    display: flex;
    animation: fadeIn 0.4s ease both;
}

/* ============================================
   视图1：天赋系统
   ============================================ */

/* 天赋路线列表 */
.talent-list {
    padding: 16px 12px 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* 单条天赋路线 */
.talent-path {
    padding: 14px 12px 16px;
    border-radius: var(--radius-lg);
    background: linear-gradient(
        180deg,
        rgba(245, 239, 224, 0.9) 0%,
        rgba(232, 224, 204, 0.75) 100%
    );
    border: 1px solid rgba(212, 168, 83, 0.25);
    box-shadow: var(--shadow-ink);
    animation: fadeInUp 0.5s ease both;
}

.talent-path:nth-child(1) { animation-delay: 0.05s; }
.talent-path:nth-child(2) { animation-delay: 0.15s; }
.talent-path:nth-child(3) { animation-delay: 0.25s; }

/* 路线头部 */
.talent-path-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.talent-path-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

/* 三条路线不同主题色 */
.talent-path--destiny .talent-path-icon {
    background: linear-gradient(135deg, #c03c3c 0%, #a03030 100%);
    box-shadow: 0 2px 6px rgba(192, 60, 60, 0.35);
}

.talent-path--protection .talent-path-icon {
    background: linear-gradient(135deg, #6a9fb5 0%, #4a7f95 100%);
    box-shadow: 0 2px 6px rgba(106, 159, 181, 0.35);
}

.talent-path--fortune .talent-path-icon {
    background: linear-gradient(135deg, #d4a853 0%, #b08a3a 100%);
    box-shadow: 0 2px 6px rgba(212, 168, 83, 0.35);
}

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

.talent-path-name {
    font-family: var(--font-title);
    font-size: 1rem;
    color: var(--color-ink);
    letter-spacing: 0.05em;
}

.talent-path-desc {
    font-size: 0.6875rem;
    color: var(--color-ink-light);
    margin-top: 2px;
}

/* 节点轨道 */
.talent-track {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 6px 4px;
}

/* 节点之间的连线（背景层） */
.talent-track::before {
    content: '';
    position: absolute;
    top: 33px;
    left: 28px;
    right: 28px;
    height: 3px;
    background: repeating-linear-gradient(
        90deg,
        rgba(44, 44, 44, 0.2) 0,
        rgba(44, 44, 44, 0.2) 4px,
        transparent 4px,
        transparent 8px
    );
    z-index: 0;
}

/* 点亮连线（前景层，通过 JS 控制 width） */
.talent-track-line {
    position: absolute;
    top: 33px;
    left: 28px;
    height: 3px;
    background: linear-gradient(
        90deg,
        var(--color-gold) 0%,
        var(--color-gold-light) 100%
    );
    box-shadow: 0 0 6px rgba(212, 168, 83, 0.6);
    z-index: 0;
    transition: width 0.6s ease;
    border-radius: 2px;
}

/* 单个节点 */
.talent-node {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    flex: 1;
}

.talent-node-circle {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: var(--font-title);
    transition: all var(--transition-normal);
    position: relative;
}

/* 已点亮节点 */
.talent-node.is-unlocked .talent-node-circle {
    background: linear-gradient(135deg, #e8c97a 0%, #b08a3a 100%);
    color: #fff;
    border: 2px solid #f0d68a;
    box-shadow:
        0 2px 8px rgba(212, 168, 83, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.talent-node.is-unlocked .talent-node-circle::after {
    content: '✓';
    position: absolute;
    top: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-success);
    color: #fff;
    font-size: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--color-bg);
}

/* 当前可点亮节点：脉冲动画 */
.talent-node.is-current .talent-node-circle {
    background: linear-gradient(135deg, #f0d68a 0%, #d4a853 100%);
    color: #fff;
    border: 2px solid var(--color-gold-light);
    box-shadow:
        0 0 0 0 rgba(212, 168, 83, 0.6),
        0 2px 10px rgba(212, 168, 83, 0.5);
    animation: pulseGold 1.6s ease-out infinite;
}

/* 未解锁节点 */
.talent-node.is-locked .talent-node-circle {
    background: rgba(232, 224, 204, 0.6);
    color: rgba(44, 44, 44, 0.35);
    border: 2px dashed rgba(44, 44, 44, 0.25);
}

.talent-node.is-locked {
    cursor: not-allowed;
}

/* 节点名称 */
.talent-node-name {
    font-size: 0.65rem;
    color: var(--color-ink-light);
    text-align: center;
    line-height: 1.2;
    max-width: 52px;
    word-break: break-all;
}

.talent-node.is-unlocked .talent-node-name {
    color: var(--color-gold-dark);
    font-weight: 500;
}

.talent-node.is-current .talent-node-name {
    color: var(--color-ink);
    font-weight: 600;
}

/* 节点 hover 效果 */
.talent-node.is-unlocked:hover .talent-node-circle,
.talent-node.is-current:hover .talent-node-circle {
    transform: scale(1.1);
}

/* Tooltip */
.talent-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    width: 140px;
    padding: 8px 10px;
    background: rgba(44, 44, 44, 0.92);
    color: #fff;
    font-size: 0.6875rem;
    line-height: 1.5;
    border-radius: var(--radius-md);
    border: 1px solid rgba(212, 168, 83, 0.4);
    box-shadow: var(--shadow-ink-heavy);
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition-fast);
    z-index: 50;
}

.talent-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(44, 44, 44, 0.92);
}

.talent-node:hover .talent-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.talent-tooltip-title {
    font-family: var(--font-title);
    font-size: 0.75rem;
    color: var(--color-gold-light);
    margin-bottom: 2px;
}

.talent-tooltip-cost {
    margin-top: 4px;
    color: var(--color-gold);
    font-weight: 500;
}

/* 点亮金光爆发动画 */
@keyframes lightBurst {
    0% {
        transform: scale(1);
        box-shadow:
            0 0 0 0 rgba(212, 168, 83, 0.8),
            0 2px 8px rgba(212, 168, 83, 0.5);
    }
    50% {
        transform: scale(1.3);
        box-shadow:
            0 0 0 20px rgba(212, 168, 83, 0),
            0 0 30px rgba(212, 168, 83, 0.8);
    }
    100% {
        transform: scale(1);
        box-shadow:
            0 0 0 0 rgba(212, 168, 83, 0),
            0 2px 8px rgba(212, 168, 83, 0.5);
    }
}

.talent-node.is-bursting .talent-node-circle {
    animation: lightBurst 0.8s ease-out;
}

/* ============================================
   视图2：每日福利 - Tab 切换
   ============================================ */
.td-tabs {
    display: flex;
    padding: 12px 16px 8px;
    gap: 8px;
    border-bottom: 1px solid rgba(212, 168, 83, 0.2);
    background: rgba(245, 239, 224, 0.6);
}

.td-tab {
    flex: 1;
    padding: 8px 0;
    border-radius: var(--radius-md);
    font-family: var(--font-title);
    font-size: 0.875rem;
    color: var(--color-ink-light);
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-normal);
    letter-spacing: 0.05em;
}

.td-tab:hover {
    color: var(--color-ink);
}

.td-tab.is-active {
    color: var(--color-gold-dark);
    background: linear-gradient(
        180deg,
        rgba(245, 239, 224, 0.95) 0%,
        rgba(232, 224, 204, 0.85) 100%
    );
    border-color: rgba(212, 168, 83, 0.5);
    box-shadow: var(--shadow-ink);
}

/* Tab 面板 */
.td-panel {
    display: none;
    flex: 1;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 14px 24px;
}

.td-panel.is-active {
    display: flex;
    animation: fadeIn 0.4s ease both;
}

/* ============================================
   签到 Tab
   ============================================ */
.signin-section {
    margin-bottom: 20px;
}

.signin-section-title {
    font-family: var(--font-title);
    font-size: 0.9375rem;
    color: var(--color-ink);
    text-align: center;
    margin-bottom: 14px;
    letter-spacing: 0.08em;
}

.signin-section-title::before,
.signin-section-title::after {
    content: '·';
    color: var(--color-gold);
    margin: 0 8px;
}

/* 签到日历 - 7天横排 */
.signin-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    padding: 12px 8px;
    border-radius: var(--radius-lg);
    background: linear-gradient(
        180deg,
        rgba(245, 239, 224, 0.85) 0%,
        rgba(232, 224, 204, 0.7) 100%
    );
    border: 1px solid rgba(212, 168, 83, 0.25);
    box-shadow: var(--shadow-ink);
}

.signin-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    opacity: 0;
    animation: fadeInUp 0.4s ease forwards;
}

.signin-day:nth-child(1) { animation-delay: 0.05s; }
.signin-day:nth-child(2) { animation-delay: 0.12s; }
.signin-day:nth-child(3) { animation-delay: 0.19s; }
.signin-day:nth-child(4) { animation-delay: 0.26s; }
.signin-day:nth-child(5) { animation-delay: 0.33s; }
.signin-day:nth-child(6) { animation-delay: 0.40s; }
.signin-day:nth-child(7) { animation-delay: 0.47s; }

/* 圆形卡片 */
.signin-day-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: var(--font-title);
    position: relative;
    transition: all var(--transition-normal);
}

/* 已签到 */
.signin-day.is-signed .signin-day-circle {
    background: linear-gradient(135deg, #e8c97a 0%, #b08a3a 100%);
    color: #fff;
    border: 2px solid #f0d68a;
    box-shadow: 0 2px 6px rgba(212, 168, 83, 0.4);
}

.signin-day.is-signed .signin-day-circle::after {
    content: '✓';
    position: absolute;
    font-size: 0.95rem;
    color: #fff;
}

/* 今日：脉冲 + 边框高亮 */
.signin-day.is-today .signin-day-circle {
    background: linear-gradient(135deg, #f0d68a 0%, #d4a853 100%);
    color: #fff;
    border: 2px solid var(--color-red);
    box-shadow:
        0 0 0 0 rgba(192, 60, 60, 0.5),
        0 2px 10px rgba(212, 168, 83, 0.5);
    animation: pulseRed 1.4s ease-out infinite;
}

/* 未签到 */
.signin-day.is-future .signin-day-circle {
    background: rgba(232, 224, 204, 0.5);
    color: rgba(44, 44, 44, 0.4);
    border: 2px dashed rgba(44, 44, 44, 0.25);
}

/* 第7天奖励特殊样式 */
.signin-day.is-bonus .signin-day-circle {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #9b8ec4 0%, #7a6ba3 100%);
    color: #fff;
    border: 2px solid var(--color-gold);
    box-shadow: 0 2px 10px rgba(155, 142, 196, 0.5);
}

.signin-day.is-bonus .signin-day-circle::after {
    content: '★';
    font-size: 1rem;
}

/* 天数标签 */
.signin-day-label {
    font-size: 0.625rem;
    color: var(--color-ink-light);
}

.signin-day.is-signed .signin-day-label,
.signin-day.is-today .signin-day-label {
    color: var(--color-gold-dark);
    font-weight: 500;
}

.signin-day.is-bonus .signin-day-label {
    color: var(--color-purple-dark);
    font-weight: 500;
}

/* 签到按钮区 */
.signin-action {
    text-align: center;
    margin-top: 8px;
}

.btn-signin {
    width: 100%;
    max-width: 240px;
    height: 48px;
    margin: 0 auto;
    border-radius: var(--radius-lg);
    font-family: var(--font-title);
    font-size: 1.0625rem;
    letter-spacing: 0.12em;
    color: #fff;
    background: linear-gradient(
        180deg,
        #d64545 0%,
        #c03c3c 50%,
        #a83232 100%
    );
    border: 2px solid var(--color-gold);
    box-shadow:
        var(--shadow-ink),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 0 20px var(--color-red-glow);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.btn-signin:hover {
    box-shadow:
        var(--shadow-ink-heavy),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 0 30px var(--color-red-glow);
}

.btn-signin:active {
    transform: scale(0.97);
}

.btn-signin.is-disabled {
    background: linear-gradient(180deg, #bdb5a3 0%, #a8a094 100%);
    border-color: rgba(212, 168, 83, 0.4);
    box-shadow: var(--shadow-ink);
    cursor: not-allowed;
    color: rgba(255, 255, 255, 0.7);
}

/* 看广告双倍选项 */
.signin-ad-option {
    margin-top: 12px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--color-ink-light);
}

.signin-ad-option a {
    color: var(--color-purple-dark);
    text-decoration: underline;
    cursor: pointer;
}

.signin-ad-option a:hover {
    color: var(--color-purple);
}

/* 累签说明 */
.signin-summary {
    margin-top: 18px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    background: rgba(155, 142, 196, 0.1);
    border: 1px solid rgba(155, 142, 196, 0.25);
    font-size: 0.75rem;
    color: var(--color-ink-light);
    text-align: center;
}

.signin-summary strong {
    color: var(--color-purple-dark);
}

/* ============================================
   任务 Tab
   ============================================ */
.task-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 任务卡片 */
.task-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-lg);
    background: linear-gradient(
        180deg,
        rgba(245, 239, 224, 0.9) 0%,
        rgba(232, 224, 204, 0.75) 100%
    );
    border: 1px solid rgba(212, 168, 83, 0.25);
    box-shadow: var(--shadow-ink);
    animation: fadeInUp 0.4s ease both;
}

.task-card:nth-child(1) { animation-delay: 0.05s; }
.task-card:nth-child(2) { animation-delay: 0.10s; }
.task-card:nth-child(3) { animation-delay: 0.15s; }
.task-card:nth-child(4) { animation-delay: 0.20s; }
.task-card:nth-child(5) { animation-delay: 0.25s; }

/* 任务图标 */
.task-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    background: linear-gradient(
        135deg,
        rgba(212, 168, 83, 0.2) 0%,
        rgba(155, 142, 196, 0.15) 100%
    );
    border: 1px solid rgba(212, 168, 83, 0.3);
}

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

.task-name {
    font-family: var(--font-title);
    font-size: 0.875rem;
    color: var(--color-ink);
    letter-spacing: 0.03em;
}

.task-desc {
    font-size: 0.6875rem;
    color: var(--color-ink-light);
    margin-top: 1px;
}

/* 进度条 */
.task-progress {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.task-progress-bar {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: rgba(44, 44, 44, 0.1);
    overflow: hidden;
}

.task-progress-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(
        90deg,
        var(--color-gold) 0%,
        var(--color-gold-light) 100%
    );
    box-shadow: 0 0 4px rgba(212, 168, 83, 0.5);
    width: 0;
    transition: width 0.8s ease;
}

.task-progress-text {
    font-size: 0.625rem;
    color: var(--color-ink-light);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

/* 任务右侧：奖励 + 按钮 */
.task-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}

.task-reward {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.6875rem;
    color: var(--color-gold-dark);
    font-weight: 500;
}

.task-reward-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 700;
    color: #fff;
}

.task-reward-icon--gold {
    background: linear-gradient(135deg, #f0c75e 0%, #c4952e 100%);
}

.task-reward-icon--spiritStone {
    background: linear-gradient(135deg, #8eb8e0 0%, #5a8ab5 100%);
}

.task-reward-icon--merit {
    background: linear-gradient(135deg, #e8c97a 0%, #b08a3a 100%);
}

/* 任务按钮 */
.btn-task {
    min-width: 56px;
    height: 28px;
    padding: 0 12px;
    border-radius: var(--radius-pill);
    font-size: 0.6875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

/* 领取按钮（可领取，金色） */
.btn-task.btn-claim {
    background: linear-gradient(135deg, #e8c97a 0%, #d4a853 100%);
    color: #fff;
    border: 1px solid #f0d68a;
    box-shadow: 0 1px 4px rgba(212, 168, 83, 0.4);
    animation: pulseGold 1.6s ease-out infinite;
}

.btn-task.btn-claim:hover {
    box-shadow: 0 2px 8px rgba(212, 168, 83, 0.6);
}

/* 前往按钮（未完成） */
.btn-task.btn-go {
    background: linear-gradient(
        180deg,
        rgba(245, 239, 224, 0.95) 0%,
        rgba(232, 224, 204, 0.9) 100%
    );
    color: var(--color-ink);
    border: 1px solid var(--color-gold-dark);
}

.btn-task.btn-go:hover {
    border-color: var(--color-gold);
    box-shadow: var(--shadow-gold);
}

/* 已领取按钮 */
.btn-task.btn-done {
    background: rgba(90, 158, 111, 0.15);
    color: var(--color-success);
    border: 1px solid rgba(90, 158, 111, 0.4);
    cursor: default;
}

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

/* ============================================
   成就 Tab
   ============================================ */
.achievement-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

/* 成就卡片 */
.achievement-card {
    padding: 12px 10px;
    border-radius: var(--radius-lg);
    background: linear-gradient(
        180deg,
        rgba(245, 239, 224, 0.9) 0%,
        rgba(232, 224, 204, 0.75) 100%
    );
    border: 1px solid rgba(212, 168, 83, 0.25);
    box-shadow: var(--shadow-ink);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    animation: fadeInUp 0.4s ease both;
}

.achievement-card:nth-child(1) { animation-delay: 0.05s; }
.achievement-card:nth-child(2) { animation-delay: 0.10s; }
.achievement-card:nth-child(3) { animation-delay: 0.15s; }
.achievement-card:nth-child(4) { animation-delay: 0.20s; }
.achievement-card:nth-child(5) { animation-delay: 0.25s; }
.achievement-card:nth-child(6) { animation-delay: 0.30s; }

/* 已完成成就特殊样式 */
.achievement-card.is-completed {
    border-color: var(--color-gold);
    background: linear-gradient(
        180deg,
        rgba(245, 239, 224, 1) 0%,
        rgba(240, 214, 138, 0.25) 100%
    );
    box-shadow:
        var(--shadow-gold),
        0 0 12px rgba(212, 168, 83, 0.2);
}

/* 成就勋章 */
.achievement-medal {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 8px;
    background: rgba(232, 224, 204, 0.6);
    border: 2px dashed rgba(44, 44, 44, 0.25);
    color: rgba(44, 44, 44, 0.4);
}

.achievement-card.is-completed .achievement-medal {
    background: linear-gradient(135deg, #e8c97a 0%, #b08a3a 100%);
    border: 2px solid #f0d68a;
    color: #fff;
    box-shadow:
        0 2px 10px rgba(212, 168, 83, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    animation: medalPop 0.6s ease;
}

.achievement-name {
    font-family: var(--font-title);
    font-size: 0.8125rem;
    color: var(--color-ink);
    letter-spacing: 0.03em;
    margin-bottom: 2px;
}

.achievement-desc {
    font-size: 0.625rem;
    color: var(--color-ink-light);
    line-height: 1.4;
    margin-bottom: 6px;
}

/* 成就进度 */
.achievement-progress {
    font-size: 0.625rem;
    color: var(--color-ink-light);
    margin-bottom: 6px;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    background: rgba(44, 44, 44, 0.06);
}

.achievement-card.is-completed .achievement-progress {
    color: var(--color-gold-dark);
    background: rgba(212, 168, 83, 0.15);
    font-weight: 500;
}

/* 成就奖励预览 */
.achievement-reward {
    font-size: 0.625rem;
    color: var(--color-gold-dark);
    padding-top: 6px;
    border-top: 1px dashed rgba(212, 168, 83, 0.3);
    width: 100%;
}

/* ============================================
   通用弹窗 Modal
   ============================================ */
.modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(44, 44, 44, 0.6);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.modal-mask.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.modal-box {
    width: 280px;
    padding: 20px 18px 16px;
    border-radius: var(--radius-lg);
    background: linear-gradient(
        180deg,
        rgba(245, 239, 224, 1) 0%,
        rgba(232, 224, 204, 0.95) 100%
    );
    border: 1.5px solid var(--color-gold);
    box-shadow: var(--shadow-ink-heavy);
    text-align: center;
    transform: scale(0.85);
    transition: transform var(--transition-normal);
    position: relative;
}

.modal-mask.is-visible .modal-box {
    transform: scale(1);
}

.modal-title {
    font-family: var(--font-title);
    font-size: 1.125rem;
    color: var(--color-ink);
    letter-spacing: 0.08em;
    margin-bottom: 12px;
}

.modal-desc {
    font-size: 0.8125rem;
    color: var(--color-ink-light);
    line-height: 1.6;
    margin-bottom: 14px;
}

.modal-cost {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    background: rgba(212, 168, 83, 0.12);
    border: 1px solid rgba(212, 168, 83, 0.3);
    font-size: 0.75rem;
    color: var(--color-gold-dark);
    margin-bottom: 14px;
}

.modal-reward {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.modal-reward-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.modal-reward-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
}

.modal-reward-icon--gold {
    background: linear-gradient(135deg, #f0c75e 0%, #c4952e 100%);
    box-shadow: 0 2px 6px rgba(196, 149, 46, 0.4);
}

.modal-reward-icon--spiritStone {
    background: linear-gradient(135deg, #8eb8e0 0%, #5a8ab5 100%);
    box-shadow: 0 2px 6px rgba(90, 138, 181, 0.4);
}

.modal-reward-icon--merit {
    background: linear-gradient(135deg, #e8c97a 0%, #b08a3a 100%);
    box-shadow: 0 2px 6px rgba(176, 138, 58, 0.4);
}

.modal-reward-icon--bonus {
    background: linear-gradient(135deg, #9b8ec4 0%, #7a6ba3 100%);
    box-shadow: 0 2px 6px rgba(122, 107, 163, 0.4);
}

.modal-reward-value {
    font-size: 0.75rem;
    color: var(--color-ink);
    font-weight: 500;
}

.modal-reward-label {
    font-size: 0.625rem;
    color: var(--color-ink-light);
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn-modal {
    flex: 1;
    max-width: 110px;
    height: 38px;
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-modal.btn-primary {
    background: linear-gradient(
        180deg,
        #d64545 0%,
        #c03c3c 100%
    );
    color: #fff;
    border: 1.5px solid var(--color-gold);
    box-shadow: var(--shadow-ink);
}

.btn-modal.btn-primary:hover {
    box-shadow: var(--shadow-ink-heavy);
}

.btn-modal.btn-primary.is-disabled {
    background: linear-gradient(180deg, #bdb5a3 0%, #a8a094 100%);
    border-color: rgba(212, 168, 83, 0.4);
    cursor: not-allowed;
    color: rgba(255, 255, 255, 0.7);
}

.btn-modal.btn-secondary {
    background: linear-gradient(
        180deg,
        rgba(245, 239, 224, 0.95) 0%,
        rgba(232, 224, 204, 0.9) 100%
    );
    color: var(--color-ink);
    border: 1.5px solid var(--color-gold-dark);
}

.btn-modal.btn-secondary:hover {
    border-color: var(--color-gold);
    box-shadow: var(--shadow-gold);
}

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

/* 弹窗关闭按钮 */
.modal-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: var(--color-ink-light);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    color: var(--color-ink);
    transform: rotate(90deg);
}

/* ============================================
   Toast 提示
   ============================================ */
.td-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 10px 24px;
    border-radius: var(--radius-md);
    background: rgba(44, 44, 44, 0.9);
    color: #fff;
    font-size: 0.8125rem;
    z-index: 2000;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-normal);
    box-shadow: var(--shadow-ink-heavy);
}

.td-toast.is-visible {
    opacity: 1;
}

/* ============================================
   金币飞出动画
   ============================================ */
.coin-fly {
    position: fixed;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f0c75e 0%, #c4952e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 2px 6px rgba(196, 149, 46, 0.5);
    pointer-events: none;
    z-index: 1500;
}

/* ============================================
   动画
   ============================================ */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulseGold {
    0% {
        box-shadow:
            0 0 0 0 rgba(212, 168, 83, 0.6),
            0 2px 10px rgba(212, 168, 83, 0.5);
    }
    70% {
        box-shadow:
            0 0 0 12px rgba(212, 168, 83, 0),
            0 2px 10px rgba(212, 168, 83, 0.5);
    }
    100% {
        box-shadow:
            0 0 0 0 rgba(212, 168, 83, 0),
            0 2px 10px rgba(212, 168, 83, 0.5);
    }
}

@keyframes pulseRed {
    0% {
        box-shadow:
            0 0 0 0 rgba(192, 60, 60, 0.5),
            0 2px 10px rgba(212, 168, 83, 0.5);
    }
    70% {
        box-shadow:
            0 0 0 10px rgba(192, 60, 60, 0),
            0 2px 10px rgba(212, 168, 83, 0.5);
    }
    100% {
        box-shadow:
            0 0 0 0 rgba(192, 60, 60, 0),
            0 2px 10px rgba(212, 168, 83, 0.5);
    }
}

@keyframes medalPop {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    60% {
        transform: scale(1.2) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0);
        opacity: 1;
    }
}

@keyframes coinFly {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--fly-x, 0), var(--fly-y, -120px)) scale(0.5);
    }
}

/* ============================================
   响应式
   ============================================ */
@media screen and (max-width: 360px) {
    .talent-node-circle {
        width: 40px;
        height: 40px;
        font-size: 0.85rem;
    }

    .talent-track::before,
    .talent-track-line {
        top: 30px;
    }

    .talent-node-name {
        font-size: 0.6rem;
        max-width: 46px;
    }

    .signin-day-circle {
        width: 34px;
        height: 34px;
        font-size: 0.7rem;
    }

    .signin-day.is-bonus .signin-day-circle {
        width: 38px;
        height: 38px;
    }

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

@media screen and (min-width: 768px) {
    .td-page {
        max-width: 420px;
        margin: 0 auto;
        min-height: 100vh;
        box-shadow: var(--shadow-ink-heavy);
    }
}
