/*
 * 求职录 · Anthropic editorial refactor
 * Direction: career field notes × warm editorial utility
 * Base tokens and Latin fonts are loaded before this file.
 */

:root {
    --z-below: -1;
    --z-base: 0;
    --z-raised: 10;
    --z-sticky: 20;
    --z-dropdown: 50;
    --z-navbar: 100;
    --z-fab: 200;
    --z-tooltip: 250;
    --z-drawer: 300;
    --z-modal: 400;
    --z-toast: 450;
    --z-command: 500;

    --font-display-cn: 'Lora', 'Noto Serif SC', 'Songti SC', serif;
    --font-heading-cn: 'Poppins', 'Noto Sans SC', 'PingFang SC', sans-serif;
    --font-body-cn: 'Lora', 'Noto Serif SC', 'Songti SC', serif;

    --color-bg-base: #ece9e0;
    --color-bg-raised: #f5f3ec;
    --color-bg-overlay: #fdfcf8;
    --color-bg-inverted: #191816;
    --color-text-primary: #191816;
    --color-text-secondary: #68655e;
    --color-text-muted: #8d8980;
    --color-text-inverted: #faf9f5;
    --color-border-default: #d2cec3;
    --color-border-subtle: #e2dfd5;
    --color-border-strong: #969188;
    --color-accent-orange: #d97757;
    --color-accent-warm: #c96442;
    --color-accent-blue: #708ca0;
    --color-accent-green: #788c5d;
    --color-accent-sand: #c4b99a;
    --color-success: #6b8f47;
    --color-warning: #b9822d;
    --color-error: #c0453a;
    --color-error-strong: #a93830;
    --color-banner-bg: #e8e0cc;
    --color-banner-border: #d8caaa;
    --color-accent-soft-text: #e8a78e;
    --color-type-bank: #6f958b;
    --color-type-civil: #586d78;
    --color-type-firm: #8e7a60;
    --color-success-strong: #557238;
    --color-preview-bg: #fffefb;
    --color-preview-border: #dedbd2;
    --color-preview-text: #1a1917;
    --color-preview-secondary: #5f5c56;
    --color-preview-rule: #2c2b28;
    --color-preview-body: #403e39;

    --shadow-soft: 0 1px 0 rgba(20, 20, 19, .04), 0 10px 32px rgba(20, 20, 19, .045);
    --shadow-lift: 0 18px 52px rgba(20, 20, 19, .1);

    /* Legacy aliases used by the application templates. */
    --c-zhu: var(--color-error);
    --c-zhu-light: var(--color-accent-orange);
    --c-zhu-dark: #9f382f;
    --c-zhu-soft: rgba(192, 69, 58, .1);
    --c-mo: var(--color-text-primary);
    --c-mo-light: #2d2b27;
    --c-rice: var(--color-bg-base);
    --c-rice-dark: var(--color-border-default);
    --c-rice-warm: var(--color-bg-raised);
    --c-dai: var(--color-accent-blue);
    --c-dai-light: #8aa2b2;
    --c-dai-soft: rgba(112, 140, 160, .1);
    --c-gold: var(--color-accent-orange);
    --c-gold-light: #e49a7e;
    --c-gold-dark: var(--color-accent-warm);
    --c-gold-soft: rgba(217, 119, 87, .11);
    --c-success: var(--color-success);
    --c-warning: var(--color-warning);
    --c-danger: var(--color-error);
    --c-info: var(--color-accent-blue);
    --c-verd: var(--color-accent-green);
    --bg-primary: var(--color-bg-base);
    --bg-secondary: var(--color-bg-raised);
    --bg-card: var(--color-bg-raised);
    --text-primary: var(--color-text-primary);
    --text-secondary: var(--color-text-secondary);
    --text-muted: var(--color-text-muted);
    --border-color: var(--color-border-default);
    --shadow-color: rgba(20, 20, 19, .07);
    --accent-color: var(--color-accent-orange);
    --progress-bg: var(--color-border-subtle);
    --progress-fill: var(--color-accent-orange);
    --gradient-paper: var(--color-bg-raised);
    --c-ink-medium: var(--color-border-default);
}

[data-theme="classic"],
[data-theme="light"] {
    color-scheme: light;
    --color-bg-base: #ece9e0;
    --color-bg-raised: #f5f3ec;
    --color-bg-overlay: #fdfcf8;
    --color-bg-inverted: #191816;
    --color-text-primary: #191816;
    --color-text-secondary: #68655e;
    --color-text-muted: #8d8980;
    --color-text-inverted: #faf9f5;
    --color-border-default: #d2cec3;
    --color-border-subtle: #e2dfd5;
}

* { box-sizing: border-box; }

html {
    touch-action: manipulation;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    margin: 0;
    color: var(--color-text-primary);
    background:
        radial-gradient(ellipse 75% 55% at 8% -5%, rgba(217, 119, 87, .09), transparent 62%),
        radial-gradient(ellipse 50% 50% at 100% 30%, rgba(120, 140, 93, .055), transparent 58%),
        var(--color-bg-base);
    font-family: var(--font-heading-cn);
    font-size: var(--text-base);
    line-height: var(--leading-cn-normal);
    text-spacing-trim: trim-start allow-end;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: var(--z-below);
    pointer-events: none;
    opacity: .26;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E");
}

button, input, select, textarea { font-family: var(--font-heading-cn); }
button { touch-action: manipulation; }
button:disabled { opacity: .55; cursor: not-allowed; }
input::placeholder, textarea::placeholder { color: var(--color-text-muted); }

:focus-visible {
    outline: 2px solid var(--color-accent-orange);
    outline-offset: 3px;
}

::selection { background: rgba(217, 119, 87, .24); }

.ink-wash-bg, .cloud-decor { display: none; }

/* Header / navigation */
.main-header {
    position: sticky;
    top: 0;
    z-index: var(--z-navbar);
    color: var(--color-text-inverted);
    background: rgba(25, 24, 22, .94);
    border-bottom: 1px solid rgba(250, 249, 245, .08);
    backdrop-filter: blur(16px);
}

.header-inner {
    width: min(100% - var(--space-8), var(--max-width-full));
    min-height: 72px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr);
    align-items: center;
    gap: var(--space-6);
}

.logo { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.logo-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 50%;
    color: var(--color-bg-inverted);
    background: var(--color-accent-orange);
    font-family: var(--font-body-cn);
    font-size: var(--text-md);
}
.logo-copy { min-width: 0; line-height: 1.2; }
.logo h1 {
    margin: 0;
    font-family: var(--font-display-cn);
    font-size: var(--text-md);
    font-weight: 500;
    letter-spacing: .06em;
}
.logo-sub {
    display: block;
    margin-top: 2px;
    color: rgba(250, 249, 245, .48);
    font-family: var(--font-heading);
    font-size: 10px;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.top-nav {
    display: flex;
    align-items: stretch;
    align-self: stretch;
    gap: var(--space-1);
}
.nav-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0 var(--space-4);
    border: 0;
    color: rgba(250, 249, 245, .55);
    background: transparent;
    font-size: var(--text-sm);
    cursor: pointer;
    transition: color var(--duration-fast) ease, background var(--duration-fast) ease;
}
.nav-btn span { color: rgba(250, 249, 245, .28); font-family: var(--font-mono); font-size: 9px; }
.nav-btn::after {
    content: '';
    position: absolute;
    left: var(--space-4);
    right: var(--space-4);
    bottom: 0;
    height: 2px;
    background: var(--color-accent-orange);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform var(--duration-normal) var(--ease-default);
}
.nav-btn:hover { color: var(--color-text-inverted); background: rgba(250, 249, 245, .04); }
.nav-btn.active { color: var(--color-text-inverted); }
.nav-btn.active span { color: var(--color-accent-orange); }
.nav-btn.active::after { transform: scaleX(1); }

.header-actions { justify-self: end; display: flex; gap: var(--space-2); }
.action-btn {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(250, 249, 245, .12);
    border-radius: var(--radius-full);
    color: rgba(250, 249, 245, .72);
    background: rgba(250, 249, 245, .04);
    cursor: pointer;
    transition: transform var(--duration-fast) var(--ease-default), background var(--duration-fast) ease, color var(--duration-fast) ease;
}
.action-btn:hover { transform: translateY(-2px); color: var(--color-text-inverted); background: rgba(250, 249, 245, .12); }
.action-gold { border-color: rgba(217, 119, 87, .35); color: var(--color-accent-soft-text); }
.action-danger { color: var(--color-accent-soft-text); }
.action-danger:hover { background: var(--color-error); color: white; border-color: var(--color-error); }

@keyframes btnPulseGlow {
    50% { box-shadow: 0 0 0 8px rgba(217, 119, 87, 0); transform: scale(1.05); }
}
.action-btn.pulse-glow { box-shadow: 0 0 0 0 rgba(217, 119, 87, .45); animation: btnPulseGlow 1.5s ease-out infinite; }

/* Security banner */
.security-notice {
    position: relative;
    z-index: var(--z-sticky);
    display: none;
    color: var(--color-text-primary);
    background: var(--color-banner-bg);
    border-bottom: 1px solid var(--color-banner-border);
}
.notice-content {
    width: min(100% - var(--space-8), var(--max-width-full));
    min-height: 44px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--text-sm);
}
.notice-icon { color: var(--color-warning); }
.notice-close { margin-left: auto; width: 32px; height: 32px; border-radius: var(--radius-full); cursor: pointer; }
.notice-close:hover { background: rgba(20, 20, 19, .07); }

/* Main / view transition */
.main-content {
    width: min(100% - var(--space-8), var(--max-width-full));
    margin: 0 auto;
    padding: var(--space-10) 0 var(--space-24);
}
.view-section { display: none; }
.view-section.active { display: block; animation: fadeUp var(--duration-slow) var(--ease-default) both; }

/* Signature non-standard element: asymmetric editorial orbit. */
.workspace-intro {
    position: relative;
    min-height: 250px;
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(260px, .7fr);
    align-items: center;
    gap: var(--space-12);
    padding: var(--space-8) clamp(var(--space-8), 5vw, var(--space-16));
    margin-bottom: var(--space-10);
    overflow: hidden;
    border: 1px solid rgba(250, 249, 245, .08);
    border-radius: var(--radius-xl);
    color: var(--color-text-inverted);
    background:
        radial-gradient(circle at 78% 40%, rgba(217, 119, 87, .16), transparent 26%),
        var(--color-bg-inverted);
}
.workspace-intro::before {
    content: '';
    position: absolute;
    width: 360px;
    height: 360px;
    right: -120px;
    bottom: -220px;
    border: 1px solid rgba(250, 249, 245, .09);
    border-radius: 50%;
}
.workspace-intro-copy { position: relative; z-index: var(--z-raised); max-width: 760px; }
.workspace-kicker {
    margin: 0 0 var(--space-4);
    color: var(--color-accent-orange);
    font-family: var(--font-heading);
    font-size: var(--text-xs);
    letter-spacing: .14em;
}
.workspace-intro h2 {
    max-width: 18ch;
    margin: 0;
    font-family: var(--font-display-cn);
    font-size: clamp(2.1rem, 4.5vw, 4.35rem);
    font-weight: 400;
    line-height: 1.22;
    letter-spacing: -.035em;
    text-wrap: balance;
}
.workspace-intro h2 em { color: var(--color-accent-soft-text); font-weight: 400; }
.workspace-lead {
    max-width: 46ch;
    margin: var(--space-5) 0 0;
    color: rgba(250, 249, 245, .58);
    font-family: var(--font-body-cn);
    font-size: var(--text-base);
    line-height: var(--leading-cn-normal);
}
.workspace-orbit {
    position: relative;
    justify-self: center;
    width: 190px;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border: 1px solid rgba(250, 249, 245, .18);
    border-radius: 50%;
    transform: rotate(-8deg);
}
.workspace-orbit::before, .workspace-orbit::after {
    content: '';
    position: absolute;
    inset: 16px;
    border: 1px solid rgba(217, 119, 87, .3);
    border-radius: 50%;
}
.workspace-orbit::after { inset: 46px; border-color: rgba(250, 249, 245, .12); }
.orbit-word {
    font-family: var(--font-body-cn);
    font-size: var(--text-2xl);
    letter-spacing: .18em;
    writing-mode: vertical-rl;
    transform: rotate(8deg);
}
.orbit-dot { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: var(--color-accent-orange); }
.orbit-dot-a { top: 14px; left: 38px; }
.orbit-dot-b { right: 5px; bottom: 52px; width: 6px; height: 6px; background: var(--color-accent-green); }

/* Tabs */
.category-tabs {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: var(--space-6);
    border-bottom: 1px solid var(--color-border-default);
}
.tab-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 48px;
    padding: var(--space-2) var(--space-5);
    border: 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    color: var(--color-text-muted);
    background: transparent;
    font-size: var(--text-sm);
    cursor: pointer;
    transition: color var(--duration-fast) ease, border-color var(--duration-fast) ease;
}
.tab-btn:hover { color: var(--color-text-primary); }
.tab-btn.active { color: var(--color-text-primary); border-bottom-color: var(--color-accent-orange); }
.tab-icon { filter: grayscale(1); opacity: .72; }
.tab-btn.active .tab-icon { filter: none; opacity: 1; }
.tab-count {
    min-width: 22px;
    height: 22px;
    display: inline-grid;
    place-items: center;
    padding: 0 var(--space-2);
    border-radius: var(--radius-full);
    color: var(--color-text-secondary);
    background: var(--color-border-subtle);
    font-family: var(--font-mono);
    font-size: 10px;
}
.tab-btn.active .tab-count { color: var(--color-accent-warm); background: rgba(217, 119, 87, .13); }

/* Filter panel / search / dropdown */
.filter-bar {
    position: relative;
    display: grid;
    grid-template-columns: minmax(160px, .65fr) minmax(260px, 1.6fr) minmax(190px, .8fr);
    align-items: end;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
    padding: var(--space-5);
    background: rgba(245, 243, 236, .72);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(12px);
}
.filter-group { position: relative; display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.filter-group label {
    color: var(--color-text-secondary);
    font-size: var(--text-xs);
    font-weight: 500;
    letter-spacing: .05em;
}
.custom-select { position: relative; min-width: 0; }
.custom-select-trigger,
.filter-group input {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-md);
    color: var(--color-text-primary);
    background: var(--color-bg-overlay);
    font-size: var(--text-sm);
    transition: border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}
.custom-select-trigger { cursor: pointer; padding-right: var(--space-8); }
.custom-select-trigger::after {
    content: '⌄';
    position: absolute;
    right: var(--space-4);
    color: var(--color-text-muted);
    transition: transform var(--duration-normal) var(--ease-default);
}
.custom-select.open .custom-select-trigger::after { transform: rotate(180deg); }
.custom-select-trigger:hover, .filter-group input:hover { border-color: var(--color-border-strong); }
.custom-select.open .custom-select-trigger, .filter-group input:focus {
    outline: none;
    border-color: var(--color-accent-orange);
    box-shadow: 0 0 0 3px rgba(217, 119, 87, .15);
}
.custom-select-options {
    position: absolute;
    top: calc(100% + var(--space-2));
    left: 0;
    z-index: var(--z-dropdown);
    min-width: 100%;
    width: max-content;
    max-height: 330px;
    overflow-y: auto;
    padding: var(--space-2);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-lg);
    background: var(--color-bg-overlay);
    box-shadow: var(--shadow-lift);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(.98);
    transform-origin: top left;
    transition: opacity var(--duration-fast) ease, transform var(--duration-fast) var(--ease-default), visibility var(--duration-fast);
}
.custom-select.open .custom-select-options { opacity: 1; visibility: visible; transform: none; }
.custom-select-option {
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    font-size: var(--text-sm);
    cursor: pointer;
    white-space: nowrap;
}
.custom-select-option:hover, .custom-select-option.selected { color: var(--color-text-primary); background: var(--color-bg-raised); }
.custom-select-option.selected::after { content: '✓'; margin-left: auto; color: var(--color-accent-orange); }
.option-dot { width: 7px; height: 7px; margin-left: auto; border-radius: 50%; }
.scroll-decoration-line { display: none; }
.native-select { position: absolute; opacity: 0; pointer-events: none; }
.search-group { position: relative; }
.search-group input { padding-left: var(--space-4); padding-right: 50px; }
.search-btn {
    position: absolute;
    right: var(--space-2);
    bottom: 6px;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    cursor: pointer;
}
.search-btn:hover { color: white; background: var(--color-accent-orange); }

/* KPI stats */
.stats-overview {
    display: grid;
    grid-template-columns: 1.4fr repeat(3, 1fr);
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}
.stat-card {
    position: relative;
    min-height: 116px;
    display: flex;
    flex-direction: column-reverse;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-5) var(--space-6);
    overflow: hidden;
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
    background: var(--color-bg-raised);
    transition: transform var(--duration-normal) var(--ease-default), box-shadow var(--duration-normal) ease;
}
.stat-card:first-child { color: var(--color-text-inverted); background: var(--color-bg-inverted); border-color: var(--color-bg-inverted); }
.stat-card:first-child::after {
    content: 'ALL';
    position: absolute;
    right: var(--space-5);
    bottom: -18px;
    color: rgba(250, 249, 245, .045);
    font-family: var(--font-heading);
    font-size: 4.6rem;
    font-weight: 700;
    letter-spacing: -.08em;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-soft); }
.stat-number {
    display: block;
    color: var(--color-text-primary);
    font-family: var(--font-display);
    font-size: clamp(2rem, 3vw, 2.8rem);
    font-variant-numeric: tabular-nums;
    line-height: 1;
    letter-spacing: -.035em;
}
.stat-card:first-child .stat-number { color: var(--color-text-inverted); }
.stat-label {
    color: var(--color-text-muted);
    font-size: var(--text-xs);
    font-weight: 500;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.stat-card:first-child .stat-label { color: rgba(250, 249, 245, .48); }

/* Application cards */
.tiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-5);
    margin-bottom: var(--space-20);
}
.tile-card {
    position: relative;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-lg);
    background: var(--color-bg-raised);
    box-shadow: none;
    cursor: pointer;
    isolation: isolate;
    animation: fadeUp var(--duration-slow) var(--ease-default) both;
    transition: transform var(--duration-normal) var(--ease-default), box-shadow var(--duration-normal) ease, border-color var(--duration-fast) ease;
}
.tile-card::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--type-color, var(--color-accent-sand));
}
.tile-card[data-type="internet"] { --type-color: var(--color-accent-blue); }
.tile-card[data-type="state"], .tile-card[data-type="central"] { --type-color: var(--color-error); }
.tile-card[data-type="private"] { --type-color: var(--color-accent-green); }
.tile-card[data-type="bank"] { --type-color: var(--color-type-bank); }
.tile-card[data-type="institution"] { --type-color: var(--color-accent-green); }
.tile-card[data-type="civil"] { --type-color: var(--color-type-civil); }
.tile-card[data-type="firm"] { --type-color: var(--color-type-firm); }
.tile-card:hover { transform: translateY(-3px); border-color: var(--color-border-strong); box-shadow: var(--shadow-lift); }
.tile-card.dragging { opacity: .55; transform: scale(.98); }
.tile-card.drag-over { border-color: var(--color-accent-orange); box-shadow: 0 0 0 3px rgba(217, 119, 87, .14); }
.tile-header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-5) var(--space-5) var(--space-3) var(--space-6); }
.tile-type-tag {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-3);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-full);
    color: var(--color-text-secondary) !important;
    background: var(--color-bg-overlay);
    font-size: var(--text-xs);
    font-weight: 500;
}
.tile-actions { display: flex; gap: var(--space-1); opacity: 0; transition: opacity var(--duration-fast) ease; }
.tile-card:hover .tile-actions, .tile-card:focus-within .tile-actions { opacity: 1; }
.tile-action-btn, .progress-item-btn {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-md);
    color: var(--color-text-muted);
    cursor: pointer;
}
.tile-action-btn:hover, .progress-item-btn:hover { color: var(--color-text-primary); background: var(--color-border-subtle); }
.tile-body { padding: 0 var(--space-5) var(--space-5) var(--space-6); }
.tile-company {
    overflow: hidden;
    color: var(--color-text-primary);
    font-family: var(--font-display-cn);
    font-size: var(--text-xl);
    font-weight: 500;
    line-height: 1.45;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tile-position { margin-top: var(--space-1); color: var(--color-text-secondary); font-size: var(--text-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-date, .tile-resume-tag { margin-top: var(--space-3); color: var(--color-text-muted); font-family: var(--font-mono); font-size: 11px; }
.tile-resume-tag { display: inline-flex; padding: 3px var(--space-2); border-radius: var(--radius-sm); color: var(--color-accent-warm); background: rgba(217, 119, 87, .09); }
.tile-progress { padding: var(--space-4) var(--space-5) var(--space-5) var(--space-6); border-top: 1px solid var(--color-border-subtle); }
.progress-label { display: flex; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-2); color: var(--color-text-muted); font-size: var(--text-xs); }
.progress-current { color: var(--color-text-primary); font-weight: 500; }
.progress-bar-track { height: 5px; overflow: hidden; border-radius: var(--radius-full); background: var(--color-border-subtle); }
.progress-bar-fill { height: 100%; border-radius: inherit; background: var(--color-accent-orange); transition: width var(--duration-slow) var(--ease-default); }
.progress-nodes { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
.progress-node { padding: 2px var(--space-2); border-radius: var(--radius-full); color: var(--color-text-muted); background: var(--color-border-subtle); font-size: 10px; }
.progress-node.completed { color: var(--color-success); background: rgba(107, 143, 71, .1); }
.progress-node.active { color: var(--color-accent-warm); background: rgba(217, 119, 87, .13); }

/* Empty state */
.empty-state {
    display: none;
    min-height: 360px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: var(--space-3);
    padding: var(--space-16) clamp(var(--space-8), 8vw, var(--space-24));
    border: 1px dashed var(--color-border-default);
    border-radius: var(--radius-xl);
    background: rgba(245, 243, 236, .5);
}
.empty-state.show { display: flex; animation: fadeUp var(--duration-slow) var(--ease-default); }
.empty-icon { color: var(--color-accent-sand); font-size: 3rem; filter: grayscale(1); }
.empty-state h3 { margin: 0; font-family: var(--font-display-cn); font-size: var(--text-2xl); font-weight: 400; }
.empty-state p { max-width: 36ch; margin: 0; color: var(--color-text-muted); font-size: var(--text-sm); }

/* FAB */
.fab-add {
    position: fixed;
    right: var(--space-8);
    bottom: var(--space-8);
    z-index: var(--z-fab);
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: var(--radius-full);
    color: white;
    background: var(--color-accent-orange);
    box-shadow: 0 8px 26px rgba(217, 119, 87, .38);
    font-size: var(--text-2xl);
    cursor: pointer;
    transition: transform var(--duration-normal) var(--ease-bounce), box-shadow var(--duration-normal) ease, background var(--duration-fast) ease;
}
.fab-add:hover { transform: scale(1.07) rotate(45deg); background: var(--color-accent-warm); box-shadow: 0 14px 34px rgba(217, 119, 87, .44); }
.fab-add:active { transform: scale(.95) rotate(45deg); }

/* Modal system */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
    overflow-y: auto;
    overscroll-behavior: contain;
    background: rgba(20, 20, 19, .56);
    backdrop-filter: blur(6px);
}
.modal-overlay.show { display: flex; animation: fadeIn var(--duration-fast) ease; }
.modal-content {
    width: min(100%, 560px);
    max-height: min(90vh, 860px);
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-xl);
    background: var(--color-bg-overlay);
    box-shadow: 0 30px 100px rgba(20, 20, 19, .28);
    animation: modalUp var(--duration-normal) var(--ease-default);
}
.modal-large { width: min(100%, 760px); }
.modal-small { width: min(100%, 430px); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalUp { from { opacity: 0; transform: translateY(20px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-6) var(--space-6) 0; }
.modal-header h3 { margin: 0; font-family: var(--font-display-cn); font-size: var(--text-xl); font-weight: 400; }
.modal-close { width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--radius-md); color: var(--color-text-muted); cursor: pointer; }
.modal-close:hover { color: var(--color-text-primary); background: var(--color-bg-raised); }

/* Forms and buttons */
.record-form, .detail-body { padding: var(--space-6); }
.form-row { display: flex; gap: var(--space-4); margin-bottom: var(--space-4); }
.form-group { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: var(--space-2); }
.form-group > label { color: var(--color-text-primary); font-size: var(--text-sm); font-weight: 500; }
.required { color: var(--color-error); }
.form-group input, .form-group select, .form-group textarea,
.add-node-form input, .progress-item-edit-form input {
    width: 100%;
    min-height: 44px;
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-md);
    color: var(--color-text-primary);
    background: var(--color-bg-overlay);
    font-size: var(--text-sm);
    transition: border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}
.form-group textarea { min-height: 92px; resize: vertical; line-height: var(--leading-cn-normal); }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus,
.add-node-form input:focus, .progress-item-edit-form input:focus {
    outline: none;
    border-color: var(--color-accent-orange);
    box-shadow: 0 0 0 3px rgba(217, 119, 87, .14);
}
.form-actions { display: flex; justify-content: flex-end; gap: var(--space-3); margin-top: var(--space-6); padding-top: var(--space-5); border-top: 1px solid var(--color-border-subtle); }
.btn-primary, .btn-secondary, .btn-danger,
.btn-offer, .btn-terminated, .btn-small, .btn-add-item, .btn-add-detail {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-5);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: transform var(--duration-fast) var(--ease-default), background var(--duration-fast) ease, border-color var(--duration-fast) ease;
}
.btn-primary { color: white; background: var(--color-accent-orange); border-color: var(--color-accent-orange); }
.btn-primary:hover { background: var(--color-accent-warm); border-color: var(--color-accent-warm); transform: translateY(-1px); }
.btn-secondary { color: var(--color-text-primary); background: transparent; border-color: var(--color-border-default); }
.btn-secondary:hover { background: var(--color-bg-raised); border-color: var(--color-border-strong); }
.btn-danger { color: white; background: var(--color-error); border-color: var(--color-error); }
.btn-danger:hover { background: var(--color-error-strong); transform: translateY(-1px); }
.detail-actions-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.btn-offer { color: var(--color-success-strong); border-color: rgba(107, 143, 71, .32); background: rgba(107, 143, 71, .1); }
.btn-offer:hover { color: white; background: var(--color-success); }
.btn-terminated { color: var(--color-error); border-color: rgba(192, 69, 58, .32); background: rgba(192, 69, 58, .08); }
.btn-terminated:hover { color: white; background: var(--color-error); }

/* Detail timeline */
.detail-section { margin-bottom: var(--space-8); }
.detail-section:last-child { margin-bottom: 0; }
.detail-section-title { margin-bottom: var(--space-4); font-family: var(--font-display-cn); font-size: var(--text-md); font-weight: 500; }
.detail-info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-4); }
.detail-info-item { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.detail-info-label { color: var(--color-text-muted); font-size: var(--text-xs); letter-spacing: .04em; }
.detail-info-value { color: var(--color-text-primary); font-size: var(--text-sm); font-weight: 500; overflow-wrap: anywhere; }
.detail-progress-list { position: relative; display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-4); }
.detail-progress-list::before { content: ''; position: absolute; left: 21px; top: 16px; bottom: 16px; width: 1px; background: var(--color-border-default); }
.detail-progress-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-height: 58px;
    padding: var(--space-3) var(--space-4);
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    background: var(--color-bg-raised);
    cursor: grab;
    transition: border-color var(--duration-fast) ease, transform var(--duration-fast) var(--ease-default);
}
.detail-progress-item[data-index="0"] { cursor: default; }
.detail-progress-item:hover { border-color: var(--color-border-default); }
.detail-progress-item.dragging { opacity: .55; transform: scale(.98); }
.detail-progress-item.active-item { border-color: rgba(217, 119, 87, .35); background: rgba(217, 119, 87, .07); }
.progress-item-number { position: relative; z-index: var(--z-raised); width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; border: 2px solid var(--color-border-default); border-radius: 50%; color: var(--color-text-muted); background: var(--color-bg-raised); font-family: var(--font-mono); font-size: 10px; }
.active-item .progress-item-number { color: white; border-color: var(--color-accent-orange); background: var(--color-accent-orange); box-shadow: 0 0 0 4px rgba(217, 119, 87, .14); }
.progress-item-info { flex: 1; min-width: 0; }
.progress-item-main { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); }
.progress-item-name { font-size: var(--text-sm); font-weight: 500; }
.progress-item-date { padding: 1px var(--space-2); border-radius: var(--radius-full); color: var(--color-text-muted); background: var(--color-border-subtle); font-family: var(--font-mono); font-size: 10px; }
.progress-item-note { margin-top: 2px; overflow: hidden; color: var(--color-text-muted); font-size: var(--text-xs); text-overflow: ellipsis; white-space: nowrap; }
.progress-item-actions { display: flex; gap: var(--space-1); opacity: 0; transition: opacity var(--duration-fast) ease; }
.detail-progress-item:hover .progress-item-actions, .detail-progress-item:focus-within .progress-item-actions { opacity: 1; }
.add-node-form { display: grid; grid-template-columns: 1fr 150px 1fr auto; gap: var(--space-2); }
.add-node-form .btn-small { min-height: 44px; color: white; background: var(--color-accent-orange); }
.progress-item-edit-form { flex: 1; }
.progress-item-edit-form .edit-row { display: grid; grid-template-columns: 1fr 150px 1fr; gap: var(--space-2); }
.edit-actions { display: flex; gap: var(--space-2); margin-top: var(--space-2); }
.edit-actions button { min-height: 34px; padding: var(--space-1) var(--space-3); border-radius: var(--radius-md); cursor: pointer; }
.edit-actions .btn-save { color: white; background: var(--color-accent-orange); }
.edit-actions .btn-cancel { border: 1px solid var(--color-border-default); }

/* Calendar */
.calendar-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
    padding: var(--space-5);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-lg);
    background: var(--color-bg-raised);
}
.cal-title { min-width: 240px; text-align: center; font-family: var(--font-display-cn); font-size: var(--text-2xl); font-weight: 400; }
.cal-nav { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--color-border-default); border-radius: 50%; color: var(--color-text-secondary); cursor: pointer; }
.cal-nav:hover { color: white; border-color: var(--color-accent-orange); background: var(--color-accent-orange); }
.cal-nav-today { font-family: var(--font-body-cn); }
.calendar-stats { display: flex; justify-content: center; align-items: center; gap: var(--space-4); margin-bottom: var(--space-4); padding: var(--space-3) var(--space-5); color: var(--color-text-secondary); border: 1px solid var(--color-border-subtle); border-radius: var(--radius-lg); background: rgba(245, 243, 236, .7); font-size: var(--text-sm); }
.cal-stat-item strong { color: var(--color-accent-warm); font-family: var(--font-mono); }
.cal-stat-divider { color: var(--color-border-strong); }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--space-2); padding: var(--space-4); border: 1px solid var(--color-border-default); border-radius: var(--radius-xl); background: var(--color-bg-raised); }
.cal-weekday { padding: var(--space-2); text-align: center; color: var(--color-text-muted); font-size: var(--text-xs); font-weight: 500; letter-spacing: .08em; }
.cal-day {
    position: relative;
    min-height: 110px;
    padding: var(--space-3);
    overflow: hidden;
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
    background: var(--color-bg-overlay);
    cursor: pointer;
    animation: fadeUp var(--duration-slow) var(--ease-default) both;
    transition: transform var(--duration-normal) var(--ease-default), box-shadow var(--duration-normal) ease, border-color var(--duration-fast) ease;
}
.cal-day:hover { z-index: var(--z-raised); transform: translateY(-2px); border-color: var(--color-border-strong); box-shadow: var(--shadow-soft); }
.cal-day.other-month { opacity: .32; pointer-events: none; }
.cal-day.today { border-color: var(--color-accent-orange); box-shadow: inset 0 0 0 1px var(--color-accent-orange); }
.cal-day.heat-1 { background: linear-gradient(135deg, var(--color-bg-overlay), rgba(217, 119, 87, .045)); }
.cal-day.heat-2 { background: linear-gradient(135deg, var(--color-bg-overlay), rgba(217, 119, 87, .09)); }
.cal-day.heat-3 { background: linear-gradient(135deg, var(--color-bg-overlay), rgba(217, 119, 87, .15)); }
.cal-day-number { position: absolute; top: var(--space-2); right: var(--space-3); color: var(--color-text-muted); font-family: var(--font-mono); font-size: 11px; line-height: 1.2; text-align: right; }
.today .cal-day-number { color: var(--color-accent-warm); font-weight: 600; }
.cal-solar-term { display: block; margin-top: 2px; color: var(--color-accent-green); font-family: var(--font-heading-cn); font-size: 9px; }
.cal-day-content { display: flex; flex-direction: column; gap: 4px; margin-top: 22px; }
.cal-record-item { min-width: 0; display: flex; align-items: center; gap: 5px; padding: 2px 0; }
.cal-record-dot { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; }
.cal-node-dot { width: 5px; height: 5px; border-radius: 0; background: var(--color-accent-blue) !important; transform: rotate(45deg); }
.cal-record-name { flex: 1; min-width: 0; overflow: hidden; color: var(--color-text-primary); font-size: 11px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.cal-record-progress { padding: 0 5px; border-radius: var(--radius-full); color: var(--color-text-muted); background: var(--color-border-subtle); font-size: 9px; white-space: nowrap; }
.cal-node-progress { color: var(--color-accent-blue); background: rgba(112, 140, 160, .1); }
.cal-record-more { color: var(--color-accent-warm); font-size: 9px; text-align: center; }

/* Achievements */
.achievements-header { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: var(--space-6); margin-bottom: var(--space-8); padding: var(--space-8) 0; border-bottom: 1px solid var(--color-border-default); }
.achievements-header h2 { margin: 0; font-family: var(--font-display-cn); font-size: clamp(2.4rem, 5vw, 4.5rem); font-weight: 400; letter-spacing: -.04em; }
.achievements-header p { max-width: 28ch; margin: 0; color: var(--color-text-muted); font-family: var(--font-body-cn); }
.achievements-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-5); }
.achievement-card { position: relative; min-height: 260px; padding: var(--space-6); overflow: hidden; border: 1px solid var(--color-border-default); border-radius: var(--radius-lg); background: var(--color-bg-raised); transition: transform var(--duration-normal) var(--ease-default), box-shadow var(--duration-normal) ease; }
.achievement-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-soft); }
.achievement-card.unlocked { border-color: rgba(217, 119, 87, .45); background: linear-gradient(145deg, var(--color-bg-raised), rgba(217, 119, 87, .08)); }
.achievement-icon { display: block; margin-bottom: var(--space-5); font-size: 2.4rem; filter: grayscale(1); opacity: .48; }
.achievement-card.unlocked .achievement-icon { filter: none; opacity: 1; }
.achievement-name { font-family: var(--font-display-cn); font-size: var(--text-xl); font-weight: 500; }
.achievement-desc { min-height: 48px; margin-top: var(--space-2); color: var(--color-text-muted); font-size: var(--text-sm); }
.achievement-progress { height: 5px; margin-top: var(--space-5); overflow: hidden; border-radius: var(--radius-full); background: var(--color-border-subtle); }
.achievement-progress-bar { height: 100%; border-radius: inherit; background: var(--color-accent-orange); }
.achievement-status { margin-top: var(--space-2); color: var(--color-text-muted); font-family: var(--font-mono); font-size: 10px; }
.ach-tier-badge { position: absolute; top: var(--space-5); right: var(--space-5); padding: 3px var(--space-2); border-radius: var(--radius-full); color: var(--color-accent-warm); background: rgba(217, 119, 87, .11); font-size: 10px; }
.ach-card-shine { display: none; }

/* Supporting dialogs */
.confirm-text, .clear-warn-body, .disclaimer-body, .reminder-body { padding: var(--space-5) var(--space-6); color: var(--color-text-secondary); }
.confirm-text { text-align: center; }
#confirmModal .form-actions, .clear-warn-body + .form-actions { margin: 0; padding: var(--space-5) var(--space-6) var(--space-6); }
.clear-warn-body, .disclaimer-body, .reminder-body { text-align: center; }
.clear-warn-icon, .disclaimer-icon, .reminder-icon { margin-bottom: var(--space-3); font-size: 2.6rem; }
.clear-warn-list, .disclaimer-list { margin: var(--space-4) 0; text-align: left; }
.clear-warn-list li, .disclaimer-list li { position: relative; padding-left: var(--space-5); margin-bottom: var(--space-2); font-size: var(--text-sm); }
.clear-warn-list li::before, .disclaimer-list li::before { content: '—'; position: absolute; left: 0; color: var(--color-accent-orange); }
.disclaimer-lead { color: var(--color-text-primary); font-family: var(--font-display-cn); font-size: var(--text-md); }
.disclaimer-hint, .clear-warn-hint { color: var(--color-text-muted); font-size: var(--text-xs); }
.disclaimer-list code { padding: 1px var(--space-1); border-radius: var(--radius-sm); background: var(--color-border-subtle); font-family: var(--font-mono); }

/* Calendar picker */
.pick-header { justify-content: space-between; }
.pick-body { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4) var(--space-5) var(--space-5); }
.pick-item { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3); border: 1px solid var(--color-border-subtle); border-radius: var(--radius-lg); background: var(--color-bg-raised); cursor: pointer; transition: transform var(--duration-fast) var(--ease-default), border-color var(--duration-fast) ease; }
.pick-item:hover { transform: translateX(3px); border-color: var(--color-accent-orange); }
.pick-item-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: var(--color-bg-overlay); }
.pick-item-info { flex: 1; min-width: 0; }
.pick-item-company { overflow: hidden; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.pick-item-position { color: var(--color-text-muted); font-size: var(--text-xs); }
.pick-item-arrow { color: var(--color-accent-orange); }
.pick-empty { padding: var(--space-8); text-align: center; color: var(--color-text-muted); }

/* Reward modal */
.modal-reward { width: min(100%, 420px); overflow: visible; border-color: rgba(217, 119, 87, .4); }
.reward-header { justify-content: space-between; }
.reward-body { padding: var(--space-4) var(--space-8) var(--space-8); text-align: center; }
.reward-intro { margin-bottom: var(--space-5); }
.reward-intro p { color: var(--color-text-secondary); font-family: var(--font-body-cn); }
.reward-quote { color: var(--color-accent-orange); font-family: var(--font-display); font-size: var(--text-2xl); }
.reward-qrcode-wrap { display: inline-block; padding: var(--space-2); border-radius: var(--radius-xl); background: var(--color-bg-inverted); }
.reward-qrcode-border { padding: var(--space-3); border-radius: var(--radius-lg); background: var(--color-bg-overlay); }
.reward-qrcode-img { width: 220px; height: 220px; object-fit: contain; border-radius: var(--radius-md); }
.reward-blessing { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-5); color: var(--color-text-muted); font-size: var(--text-xs); }
.blessing-line { flex: 1; height: 1px; background: var(--color-border-default); }
.reward-scroll-top, .reward-scroll-bottom { display: none; }

/* App toast */
.app-toast {
    position: fixed;
    top: var(--space-6);
    left: 50%;
    z-index: var(--z-toast);
    min-width: 280px;
    max-width: min(420px, calc(100vw - var(--space-8)));
    padding: var(--space-4) var(--space-5);
    border: 1px solid var(--color-border-default);
    border-left-width: 3px;
    border-radius: var(--radius-lg);
    color: var(--color-text-primary);
    background: var(--color-bg-overlay);
    box-shadow: var(--shadow-lift);
    font-size: var(--text-sm);
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(-20px);
    transition: opacity var(--duration-normal) var(--ease-default), transform var(--duration-normal) var(--ease-default);
}
.app-toast--info { border-left-color: var(--color-accent-blue); }
.app-toast--success { border-left-color: var(--color-success); }
.app-toast--warning { border-left-color: var(--color-warning); }
.app-toast--error { border-left-color: var(--color-error); }

/* Achievement toast keeps its celebratory logic, with calmer styling. */
#achievementToast { position: fixed; left: 50%; bottom: var(--space-8); z-index: var(--z-toast); opacity: 0; transform: translateX(-50%) translateY(120%); }
#achievementToast.show { animation: toastUp var(--duration-slow) var(--ease-bounce) forwards; }
#achievementToast.hide { animation: toastDown var(--duration-normal) ease forwards; }
@keyframes toastUp { to { opacity: 1; transform: translateX(-50%) translateY(0); } }
@keyframes toastDown { to { opacity: 0; transform: translateX(-50%) translateY(30px); } }
.ach-toast-inner { position: relative; min-width: 330px; display: flex; align-items: center; gap: var(--space-4); padding: var(--space-5); overflow: hidden; border: 1px solid rgba(217, 119, 87, .35); border-radius: var(--radius-xl); color: var(--color-text-primary); background: var(--color-bg-overlay); box-shadow: var(--shadow-lift); }
.ach-toast-icon-wrap { position: relative; width: 52px; height: 52px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: rgba(217, 119, 87, .12); }
.ach-toast-icon { font-size: var(--text-2xl); }
.ach-toast-content { position: relative; z-index: var(--z-raised); }
.ach-toast-label { color: var(--color-accent-warm); font-size: 10px; letter-spacing: .1em; }
.ach-toast-name { font-family: var(--font-display-cn); font-size: var(--text-lg); }
.ach-toast-desc { color: var(--color-text-muted); font-size: var(--text-xs); }
.ach-toast-particles { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.ach-particle { position: absolute; width: 5px; height: 5px; border-radius: 50%; animation: particleBurst ease-out forwards; }
@keyframes particleBurst { to { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(0); } }
@keyframes flameRise { to { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(.3) rotate(180deg); } }
.ach-particle-rise { animation-name: flameRise !important; }
.ach-toast-glow, .ach-toast-flame, .ach-toast-icon-ring, .ach-toast-icon-aura { display: none; }

/* Resume list */
.resume-list-header {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: var(--space-6);
    margin-bottom: var(--space-8);
    padding: var(--space-8);
    border-radius: var(--radius-xl);
    color: var(--color-text-inverted);
    background: var(--color-bg-inverted);
}
.resume-list-title { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 0 var(--space-4); }
.resume-list-icon { grid-row: 1 / 3; font-size: 2.2rem; filter: grayscale(1); }
.resume-list-title h2 { margin: 0; font-family: var(--font-display-cn); font-size: var(--text-2xl); font-weight: 400; }
.resume-list-sub { color: rgba(250, 249, 245, .5); font-size: var(--text-xs); }
.resume-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--space-5); margin-bottom: var(--space-20); }
.resume-card { position: relative; min-width: 0; padding: var(--space-6); overflow: hidden; border: 1px solid var(--color-border-default); border-radius: var(--radius-lg); background: var(--color-bg-raised); cursor: pointer; transition: transform var(--duration-normal) var(--ease-default), box-shadow var(--duration-normal) ease; }
.resume-card::after { content: 'CV'; position: absolute; right: var(--space-4); bottom: -24px; color: rgba(20, 20, 19, .035); font-family: var(--font-heading); font-size: 5rem; font-weight: 700; }
.resume-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.resume-card-icon { display: block; margin-bottom: var(--space-4); font-size: 2rem; filter: grayscale(1); }
.resume-card-title { overflow: hidden; font-family: var(--font-display-cn); font-size: var(--text-xl); font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.resume-card-meta { display: flex; flex-direction: column; gap: var(--space-1); margin-top: var(--space-2); color: var(--color-text-muted); font-size: var(--text-xs); }
.resume-card-apps { position: relative; z-index: var(--z-raised); display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-4); }
.resume-app-tag { padding: 2px var(--space-2); border-radius: var(--radius-full); color: var(--color-accent-warm); background: rgba(217, 119, 87, .1); font-size: 10px; }
.resume-card-actions { position: relative; z-index: var(--z-raised); display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-5); opacity: 0; transition: opacity var(--duration-fast) ease; }
.resume-card:hover .resume-card-actions, .resume-card:focus-within .resume-card-actions { opacity: 1; }
.resume-card-actions button { min-height: 34px; padding: var(--space-1) var(--space-3); border: 1px solid var(--color-border-default); border-radius: var(--radius-md); font-size: var(--text-xs); cursor: pointer; }
.resume-card-actions button:hover { border-color: var(--color-accent-orange); background: rgba(217, 119, 87, .09); }

/* Resume editor */
.editor-intro { position: relative; display: flex; align-items: end; justify-content: space-between; gap: var(--space-8); margin-bottom: var(--space-4); padding: var(--space-8); overflow: hidden; border-radius: var(--radius-xl); color: var(--color-text-inverted); background: var(--color-bg-inverted); }
.editor-intro::after { content: 'Aa'; position: absolute; right: 28px; top: -42px; color: rgba(250, 249, 245, .045); font-family: var(--font-display); font-size: 10rem; line-height: 1; pointer-events: none; }
.editor-kicker, .preview-eyebrow, .source-kicker { display: block; margin-bottom: var(--space-2); color: var(--color-accent-orange); font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: .16em; }
.editor-intro h2 { max-width: 720px; margin: 0; font-family: var(--font-display-cn); font-size: clamp(1.65rem, 3vw, 2.7rem); font-weight: 400; letter-spacing: -.025em; }
.editor-intro p { margin: var(--space-2) 0 0; color: rgba(250, 249, 245, .62); font-size: var(--text-sm); }
.editor-trust-note { position: relative; z-index: 1; max-width: 260px; display: flex; align-items: center; gap: var(--space-2); color: rgba(250, 249, 245, .62); font-size: 11px; line-height: 1.5; }
.trust-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: #72a77c; box-shadow: 0 0 0 5px rgba(114, 167, 124, .13); }
.editor-topbar { position: sticky; top: 82px; z-index: var(--z-sticky); display: flex; align-items: center; gap: var(--space-4); margin-bottom: var(--space-5); padding: var(--space-3); border: 1px solid var(--color-border-default); border-radius: var(--radius-lg); background: rgba(245, 243, 236, .94); box-shadow: 0 8px 30px rgba(20, 20, 19, .06); backdrop-filter: blur(16px); }
.editor-title-group { flex: 1; min-width: 180px; display: flex; align-items: center; gap: var(--space-3); }
.editor-title-label { color: var(--color-text-muted); font-size: var(--text-xs); white-space: nowrap; }
.editor-title-input { width: 100%; min-height: 40px; padding: var(--space-2) var(--space-3); border: 1px solid var(--color-border-default); border-radius: var(--radius-md); background: var(--color-bg-overlay); font-size: var(--text-sm); font-weight: 500; }
.editor-title-input:focus { border-color: var(--color-accent-orange); box-shadow: 0 0 0 3px rgba(217, 119, 87, .14); }
.editor-topbar-actions { display: flex; gap: var(--space-2); }
.editor-main { display: grid; grid-template-columns: minmax(390px, .82fr) minmax(540px, 1.18fr); align-items: start; gap: var(--space-6); }
.editor-left { min-width: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.editor-right { position: sticky; top: 166px; min-width: 0; }
.preview-toolbar { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: 0 var(--space-4); border-radius: var(--radius-lg) var(--radius-lg) 0 0; color: #f7f3e9; background: #252522; }
.preview-toolbar strong { display: block; font-family: var(--font-display-cn); font-size: var(--text-base); font-weight: 500; }
.preview-toolbar .preview-eyebrow { margin-bottom: 1px; color: rgba(247, 243, 233, .42); }
.preview-actions { display: flex; align-items: center; gap: var(--space-2); }
.preview-status { display: inline-flex; align-items: center; gap: 7px; color: rgba(247, 243, 233, .62); font-size: 11px; white-space: nowrap; }
.preview-status i { width: 7px; height: 7px; border-radius: 50%; background: #88857e; }
.preview-status[data-state="loading"] i { background: #e0a365; animation: previewPulse 1.15s ease-in-out infinite; }
.preview-status[data-state="ready"] i { background: #72a77c; }
.preview-status[data-state="error"] i { background: #d97757; }
@keyframes previewPulse { 50% { opacity: .25; transform: scale(.7); } }
.preview-refresh { min-height: 32px; padding: 0 10px; border: 1px solid rgba(247, 243, 233, .14); border-radius: var(--radius-md); color: rgba(247, 243, 233, .76); background: transparent; font-size: 11px; cursor: pointer; }
.preview-refresh:hover { color: #fff; border-color: rgba(247, 243, 233, .32); background: rgba(255, 255, 255, .06); }
.pdf-preview-shell { position: relative; height: min(72vh, 900px); min-height: 620px; overflow: hidden; border: 1px solid #252522; border-top: 0; border-radius: 0 0 var(--radius-lg) var(--radius-lg); background: #3d3c38; box-shadow: 0 20px 60px rgba(20, 20, 19, .15); }
.pdf-preview-frame { width: 100%; height: 100%; display: none; border: 0; background: #3d3c38; }
.pdf-preview-shell.has-pdf .pdf-preview-frame { display: block; }
.pdf-preview-placeholder { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; padding: var(--space-8); color: rgba(247, 243, 233, .68); text-align: center; background: radial-gradient(circle at 50% 32%, rgba(255,255,255,.08), transparent 42%), #3d3c38; }
.pdf-preview-shell.has-pdf .pdf-preview-placeholder { display: none; }
.pdf-sheet-mark { width: 74px; aspect-ratio: 210 / 297; display: grid; place-items: center; margin-bottom: var(--space-5); border-radius: 2px; color: #8a4d39; background: #f3efe4; box-shadow: 0 12px 35px rgba(0,0,0,.28); font-family: var(--font-mono); font-size: 12px; font-weight: 700; }
.pdf-preview-placeholder strong { color: #f7f3e9; font-family: var(--font-display-cn); font-size: var(--text-lg); font-weight: 500; }
.pdf-preview-placeholder p { margin: var(--space-2) 0 0; font-size: var(--text-xs); }
.preview-footnote { margin: var(--space-3) var(--space-2) 0; color: var(--color-text-muted); font-size: 11px; text-align: center; }

.editor-module { overflow: hidden; border: 1px solid var(--color-border-default); border-radius: var(--radius-lg); background: var(--color-bg-raised); box-shadow: 0 2px 10px rgba(20, 20, 19, .025); }
.module-header { min-height: 54px; display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); cursor: pointer; }
.module-header:hover { background: var(--color-bg-overlay); }
.module-icon { width: 28px; color: var(--color-accent-warm); font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: .06em; }
.module-title { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); font-weight: 500; }
.section-title-edit { width: 28px; height: 28px; display: grid; place-items: center; border-radius: var(--radius-md); opacity: 0; cursor: pointer; }
.module-title:hover .section-title-edit, .section-title-edit:focus { opacity: 1; }
.section-title-edit:hover { background: var(--color-border-subtle); }
.section-title-input { width: 160px; padding: var(--space-1) var(--space-2); border: 1px solid var(--color-accent-orange); border-radius: var(--radius-sm); background: var(--color-bg-overlay); }
.module-toggle { margin-left: auto; color: var(--color-text-muted); transition: transform var(--duration-normal) var(--ease-default); }
.editor-module.collapsed .module-toggle { transform: rotate(-90deg); }
.editor-module.collapsed .module-body { display: none; }
.module-body { padding: 0 var(--space-4) var(--space-4); }
.repeatable-item { position: relative; margin-bottom: var(--space-3); padding: var(--space-4); border: 1px solid var(--color-border-subtle); border-radius: var(--radius-md); background: var(--color-bg-overlay); transition: opacity var(--duration-normal) ease, transform var(--duration-normal) var(--ease-default), border-color var(--duration-fast) ease; }
.repeatable-item:hover { border-color: var(--color-border-default); }
.item-header { display: flex; justify-content: space-between; margin-bottom: var(--space-3); }
.item-index { color: var(--color-text-muted); font-family: var(--font-mono); font-size: 10px; }
.item-remove, .details-remove { width: 30px; height: 30px; display: grid; place-items: center; border-radius: var(--radius-md); color: var(--color-text-muted); cursor: pointer; }
.item-remove:hover, .details-remove:hover { color: white; background: var(--color-error); }
.details-container { display: flex; flex-direction: column; gap: var(--space-3); margin-top: var(--space-3); }
.details-item { display: flex; flex-direction: column; gap: var(--space-2); transition: opacity var(--duration-normal) ease, transform var(--duration-normal) var(--ease-default); }
.details-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-2); }
.btn-add-detail { min-height: 36px; margin-top: var(--space-3); padding: var(--space-1) var(--space-3); border-style: dashed; border-color: var(--color-border-default); color: var(--color-text-muted); background: transparent; }
.btn-add-detail:hover { color: var(--color-accent-warm); border-color: var(--color-accent-orange); background: rgba(217, 119, 87, .07); }
.btn-add-item { width: 100%; border-style: dashed; border-color: var(--color-border-default); color: var(--color-text-secondary); background: transparent; }
.btn-add-item:hover { color: var(--color-accent-warm); border-color: var(--color-accent-orange); background: rgba(217, 119, 87, .07); }
.photo-upload { display: flex; align-items: center; gap: var(--space-3); }
.photo-preview { width: 58px; height: 74px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--color-border-default); border-radius: var(--radius-md); background: var(--color-bg-overlay); }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }

/* LaTeX source */
.modal-source { width: min(920px, calc(100vw - 40px)); }
.source-note { margin: 0; padding: 0 var(--space-5) var(--space-4); color: var(--color-text-muted); font-size: var(--text-xs); }
.source-code { max-height: 58vh; margin: 0 var(--space-5); padding: var(--space-5); overflow: auto; border: 1px solid rgba(250, 249, 245, .1); border-radius: var(--radius-lg); color: #eee8dc; background: #242421; font-family: var(--font-mono); font-size: 12px; line-height: 1.65; white-space: pre; }
.source-kicker { margin: 0 0 2px; }

/* Long content / scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--color-border-default) transparent; }
*::-webkit-scrollbar { width: 7px; height: 7px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { border-radius: var(--radius-full); background: var(--color-border-default); }

/* Responsive */
@media (max-width: 1180px) {
    .header-inner { grid-template-columns: auto 1fr auto; }
    .nav-btn { padding-inline: var(--space-3); }
    .nav-btn span { display: none; }
    .editor-main { grid-template-columns: 1fr; }
    .editor-right { position: static; }
    .pdf-preview-shell { height: 78vh; }
}

@media (max-width: 900px) {
    .header-inner { width: min(100% - var(--space-6), var(--max-width-full)); grid-template-columns: 1fr auto; padding-block: var(--space-3); }
    .top-nav { grid-column: 1 / -1; order: 3; overflow-x: auto; border-top: 1px solid rgba(250, 249, 245, .08); }
    .nav-btn { flex: 1 0 auto; min-height: 44px; justify-content: center; }
    .workspace-intro { grid-template-columns: 1fr; }
    .workspace-orbit { position: absolute; right: -40px; bottom: -40px; opacity: .5; }
    .filter-bar { grid-template-columns: 1fr 1fr; }
    .search-group { grid-column: 1 / -1; grid-row: 1; }
    .stats-overview { grid-template-columns: repeat(2, 1fr); }
    .add-node-form { grid-template-columns: 1fr 140px; }
    .add-node-form .btn-small { grid-column: 2; }
    .editor-topbar { position: static; }
}

@media (max-width: 640px) {
    .header-inner, .notice-content, .main-content { width: min(100% - var(--space-5), var(--max-width-full)); }
    .main-content { padding-top: var(--space-5); }
    .logo-sub { display: none; }
    .header-actions { gap: var(--space-1); }
    .action-btn { width: 34px; height: 34px; }
    .workspace-intro { min-height: 300px; padding: var(--space-8) var(--space-6); margin-bottom: var(--space-6); }
    .workspace-intro h2 { font-size: clamp(2rem, 11vw, 3.2rem); }
    .workspace-lead { max-width: 30ch; }
    .category-tabs { overflow-x: auto; }
    .tab-btn { flex: 1 0 auto; padding-inline: var(--space-3); }
    .tab-icon { display: none; }
    .filter-bar { grid-template-columns: 1fr; padding: var(--space-4); }
    .search-group { grid-column: auto; grid-row: auto; }
    .stats-overview { grid-template-columns: 1fr 1fr; }
    .stat-card { min-height: 100px; padding: var(--space-4); }
    .tiles-grid, .resume-cards-grid, .achievements-grid { grid-template-columns: 1fr; }
    .tile-actions, .resume-card-actions, .progress-item-actions { opacity: 1; }
    .form-row, .detail-actions-row { flex-direction: column; grid-template-columns: 1fr; }
    .detail-info-grid { grid-template-columns: 1fr; }
    .add-node-form, .progress-item-edit-form .edit-row { grid-template-columns: 1fr; }
    .add-node-form .btn-small { grid-column: auto; }
    .modal-overlay { align-items: flex-end; padding: 0; }
    .modal-content { width: 100%; max-height: 92vh; border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
    .calendar-header { gap: var(--space-2); padding: var(--space-3); }
    .cal-title { min-width: 0; flex: 1; font-size: var(--text-lg); }
    .calendar-stats { gap: var(--space-2); overflow-x: auto; justify-content: flex-start; white-space: nowrap; }
    .calendar-grid { gap: 3px; padding: var(--space-2); }
    .cal-weekday { padding: 3px; }
    .cal-day { min-height: 72px; padding: 4px; border-radius: var(--radius-md); }
    .cal-day-number { top: 4px; right: 5px; }
    .cal-solar-term, .cal-record-progress { display: none; }
    .cal-day-content { margin-top: 17px; }
    .cal-record-name { font-size: 9px; }
    .achievements-header { grid-template-columns: 1fr; align-items: start; }
    .resume-list-header { grid-template-columns: 1fr; }
    .editor-intro { align-items: start; flex-direction: column; }
    .editor-trust-note { max-width: 100%; }
    .editor-topbar { position: static; flex-direction: column; align-items: stretch; }
    .editor-title-group { flex-direction: column; align-items: stretch; }
    .editor-topbar-actions { justify-content: flex-end; }
    .editor-main { display: block; }
    .editor-right { margin-top: var(--space-5); }
    .pdf-preview-shell { height: 70vh; min-height: 480px; }
    .preview-toolbar { align-items: flex-start; flex-direction: column; padding-block: var(--space-3); }
    .preview-actions { width: 100%; justify-content: space-between; }
    .fab-add { right: var(--space-5); bottom: var(--space-5); width: 54px; height: 54px; }
    .form-actions { flex-wrap: wrap; }
    .reward-qrcode-img { width: 190px; height: 190px; }
    .ach-toast-inner { min-width: min(330px, calc(100vw - var(--space-6))); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}
