/* ============================================================
   neo.css —— 「Pro 系列」工具全新设计系统
   玻璃拟态 + 品牌渐变 + 微动效，独立于旧 calc-common，互不影响
   仅作用于 .neo 作用域，黑夜模式随站点 [data-theme="dark"]
   ============================================================ */

.neo {
    /* 主色（可被各工具 --neo-accent 覆盖） */
    --neo-accent: #6366f1;
    --neo-accent-2: #06b6d4;
    --neo-grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 45%, #06b6d4 100%);

    --neo-bg: #f4f6fb;
    --neo-surface: rgba(255, 255, 255, 0.82);
    --neo-surface-solid: #ffffff;
    --neo-card-bd: rgba(15, 23, 42, 0.08);
    --neo-text: #0f172a;
    --neo-text-soft: #475569;
    --neo-text-faint: #94a3b8;
    --neo-shadow: 0 10px 30px -12px rgba(30, 41, 59, 0.18);
    --neo-shadow-lg: 0 24px 60px -20px rgba(30, 41, 59, 0.28);
    --neo-radius: 18px;
    --neo-radius-sm: 12px;
    color: var(--neo-text);
}

[data-theme="dark"] .neo {
    --neo-bg: #0b1120;
    --neo-surface: rgba(30, 41, 59, 0.66);
    --neo-surface-solid: #111c33;
    --neo-card-bd: rgba(148, 163, 184, 0.16);
    --neo-text: #e8edf7;
    --neo-text-soft: #aab6cc;
    --neo-text-faint: #64748b;
    --neo-shadow: 0 12px 32px -14px rgba(0, 0, 0, 0.6);
    --neo-shadow-lg: 0 26px 60px -22px rgba(0, 0, 0, 0.75);
}

/* ---------- 顶部氛围 ---------- */
.neo-hero {
    position: relative;
    border-radius: 24px;
    padding: 30px 30px 26px;
    color: #fff;
    overflow: hidden;
    margin-bottom: 20px;
    background: var(--neo-grad);
    box-shadow: var(--neo-shadow-lg);
}
.neo-hero::before,
.neo-hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(6px);
    opacity: .5;
    pointer-events: none;
}
.neo-hero::before { width: 220px; height: 220px; right: -60px; top: -90px; background: rgba(255,255,255,.22); }
.neo-hero::after  { width: 160px; height: 160px; left: 12%; bottom: -110px; background: rgba(255,255,255,.14); }

.neo-hero-head { display: flex; align-items: center; gap: 16px; position: relative; z-index: 1; }
.neo-hero-icon {
    width: 58px; height: 58px; flex: none;
    display: grid; place-items: center;
    font-size: 30px;
    background: rgba(255, 255, 255, .2);
    border: 1px solid rgba(255, 255, 255, .32);
    border-radius: 16px;
    backdrop-filter: blur(6px);
}
.neo-hero h1 { font-size: 25px; margin: 0 0 6px; color: #fff; letter-spacing: .5px; }
.neo-hero p { margin: 0; font-size: 14px; color: rgba(255, 255, 255, .88); max-width: 720px; line-height: 1.6; }
.neo-hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; position: relative; z-index: 1; }
.neo-hero-tag {
    font-size: 12px; padding: 4px 12px; border-radius: 999px;
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .28);
    color: #fff; backdrop-filter: blur(4px);
}

/* ---------- 布局 ---------- */
.neo-layout {
    display: grid;
    grid-template-columns: minmax(360px, 440px) 1fr;
    gap: 20px;
    align-items: start;
}
.neo-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* ---------- 玻璃卡片 ---------- */
.neo-card {
    background: var(--neo-surface);
    border: 1px solid var(--neo-card-bd);
    border-radius: var(--neo-radius);
    padding: 22px;
    box-shadow: var(--neo-shadow);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    animation: neo-rise .5s cubic-bezier(.22, 1, .36, 1) both;
}
.neo-card + .neo-card { margin-top: 0; }
.neo-card-title {
    display: flex; align-items: center; gap: 9px;
    font-size: 16px; font-weight: 700; margin: 0 0 16px;
}
.neo-card-title .neo-ic {
    width: 30px; height: 30px; flex: none; display: grid; place-items: center;
    border-radius: 9px; font-size: 16px;
    background: color-mix(in srgb, var(--neo-accent) 14%, transparent);
}
.neo-card-title .neo-sub { font-size: 12px; font-weight: 500; color: var(--neo-text-faint); margin-left: auto; }

@keyframes neo-rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}
.neo-card:nth-child(2) { animation-delay: .06s; }
.neo-card:nth-child(3) { animation-delay: .12s; }

/* ---------- 表单 ---------- */
.neo-field { margin-bottom: 14px; }
.neo-field:last-child { margin-bottom: 0; }
.neo-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; color: var(--neo-text-soft); }
.neo-label b { color: var(--neo-accent); font-weight: 700; }

.neo-input,
.neo-select,
.neo-textarea {
    width: 100%;
    padding: 11px 13px;
    font-size: 14px; line-height: 1.5; font-family: inherit;
    color: var(--neo-text);
    background: var(--neo-surface-solid);
    border: 1.5px solid var(--neo-card-bd);
    border-radius: var(--neo-radius-sm);
    outline: none; box-sizing: border-box;
    transition: border-color .18s, box-shadow .18s, background .18s;
}
.neo-textarea { resize: vertical; min-height: 96px; }
.neo-input:focus, .neo-select:focus, .neo-textarea:focus {
    border-color: var(--neo-accent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--neo-accent) 16%, transparent);
}
.neo-input::placeholder, .neo-textarea::placeholder { color: var(--neo-text-faint); }
.neo-select { appearance: none; cursor: pointer;
    background-image: linear-gradient(45deg, transparent 50%, var(--neo-text-faint) 50%), linear-gradient(135deg, var(--neo-text-faint) 50%, transparent 50%);
    background-position: calc(100% - 18px) center, calc(100% - 13px) center;
    background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px;
}
[data-theme="dark"] .neo-input,
[data-theme="dark"] .neo-select,
[data-theme="dark"] .neo-textarea { background: rgba(255, 255, 255, 0.045); }

.neo-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.neo-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.neo-inline { display: flex; gap: 10px; align-items: flex-end; }
.neo-inline > * { flex: 1; min-width: 0; }

/* ---------- 分段选择 ---------- */
.neo-seg { display: flex; gap: 6px; background: color-mix(in srgb, var(--neo-accent) 8%, var(--neo-surface-solid));
    border: 1px solid var(--neo-card-bd); border-radius: 12px; padding: 4px; }
[data-theme="dark"] .neo-seg { background: rgba(255,255,255,.05); }
.neo-seg-btn {
    flex: 1; border: 0; cursor: pointer; font-family: inherit;
    padding: 8px 10px; border-radius: 9px; font-size: 13px; font-weight: 600;
    background: transparent; color: var(--neo-text-soft);
    transition: all .18s; white-space: nowrap;
}
.neo-seg-btn:hover { color: var(--neo-text); }
.neo-seg-btn.active {
    color: #fff; background: var(--neo-grad);
    box-shadow: 0 6px 16px -6px var(--neo-accent);
}

/* ---------- 按钮 ---------- */
.neo-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    border: 0; cursor: pointer; font-family: inherit; font-weight: 700; font-size: 14px;
    padding: 12px 20px; border-radius: 12px; color: #fff;
    background: var(--neo-grad); background-size: 160% 160%;
    box-shadow: 0 10px 22px -10px var(--neo-accent);
    transition: transform .16s, box-shadow .16s, background-position .3s;
}
.neo-btn:hover { transform: translateY(-2px); background-position: 100% 50%; box-shadow: 0 16px 30px -12px var(--neo-accent); }
.neo-btn:active { transform: translateY(0); }
.neo-btn--ghost {
    background: var(--neo-surface-solid); color: var(--neo-text);
    border: 1.5px solid var(--neo-card-bd); box-shadow: none;
}
[data-theme="dark"] .neo-btn--ghost { background: rgba(255,255,255,.05); }
.neo-btn--ghost:hover { border-color: var(--neo-accent); color: var(--neo-accent); }
.neo-btn--sm { padding: 7px 13px; font-size: 12.5px; border-radius: 9px; }
.neo-btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.neo-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.neo-btns .neo-btn { flex: 1; }

/* ---------- 结果区 ---------- */
.neo-result-empty { text-align: center; padding: 46px 20px; color: var(--neo-text-faint); }
.neo-result-empty .neo-emoji { font-size: 46px; display: block; margin-bottom: 12px; animation: neo-float 3s ease-in-out infinite; }
@keyframes neo-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.neo-result-empty p { margin: 0; font-size: 14px; }

.neo-hero-num {
    text-align: center; padding: 8px 6px 14px;
}
.neo-hero-num .v {
    font-size: 40px; font-weight: 800; line-height: 1.15; word-break: break-all;
    background: var(--neo-grad); -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.neo-hero-num .s { font-size: 13px; color: var(--neo-text-soft); margin-top: 8px; }

.neo-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-top: 16px; }
.neo-metric {
    background: var(--neo-surface-solid); border: 1px solid var(--neo-card-bd);
    border-radius: 13px; padding: 12px 14px;
}
[data-theme="dark"] .neo-metric { background: rgba(255,255,255,.04); }
.neo-metric .k { font-size: 12px; color: var(--neo-text-faint); margin-bottom: 5px; }
.neo-metric .v { font-size: 17px; font-weight: 700; word-break: break-all; }
.neo-metric .v.ok { color: #10b981; }
.neo-metric .v.warn { color: #f59e0b; }
.neo-metric .v.bad { color: #ef4444; }

/* 明细行 */
.neo-rows { margin-top: 16px; border: 1px solid var(--neo-card-bd); border-radius: 13px; overflow: hidden; }
.neo-row { display: flex; justify-content: space-between; gap: 14px; padding: 11px 15px; font-size: 13.5px;
    background: var(--neo-surface-solid); }
[data-theme="dark"] .neo-row { background: rgba(255,255,255,.035); }
.neo-row + .neo-row { border-top: 1px solid var(--neo-card-bd); }
.neo-row .k { color: var(--neo-text-soft); flex: none; }
.neo-row .v { font-weight: 600; text-align: right; word-break: break-all; }

/* 状态提示条 */
.neo-status { margin-top: 14px; font-size: 13px; color: var(--neo-text-soft); min-height: 20px; }
.neo-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600;
    padding: 3px 11px; border-radius: 999px; }
.neo-pill.ok { background: rgba(16,185,129,.14); color: #059669; }
.neo-pill.warn { background: rgba(245,158,11,.16); color: #d97706; }
.neo-pill.bad { background: rgba(239,68,68,.14); color: #dc2626; }
.neo-pill.info { background: color-mix(in srgb, var(--neo-accent) 14%, transparent); color: var(--neo-accent); }
[data-theme="dark"] .neo-pill.ok { color: #34d399; }
[data-theme="dark"] .neo-pill.warn { color: #fbbf24; }
[data-theme="dark"] .neo-pill.bad { color: #f87171; }

/* 提示横幅 */
.neo-banner { display: flex; gap: 10px; align-items: flex-start; border-radius: 13px; padding: 12px 15px;
    font-size: 13px; line-height: 1.6; margin-bottom: 18px;
    background: color-mix(in srgb, var(--neo-accent) 9%, var(--neo-surface-solid));
    border: 1px solid color-mix(in srgb, var(--neo-accent) 22%, transparent); }
.neo-banner .b-ic { font-size: 17px; flex: none; }

/* ---------- AI 面板 ---------- */
.neo-ai {
    margin-top: 16px; border-radius: 14px; overflow: hidden;
    border: 1px solid color-mix(in srgb, #8b5cf6 30%, transparent);
    background: linear-gradient(160deg, color-mix(in srgb, #8b5cf6 8%, var(--neo-surface-solid)), var(--neo-surface-solid));
}
.neo-ai-head { display: flex; align-items: center; gap: 8px; padding: 11px 15px; font-size: 13px; font-weight: 700;
    color: #7c3aed; background: color-mix(in srgb, #8b5cf6 12%, transparent); }
[data-theme="dark"] .neo-ai-head { color: #c4b5fd; }
.neo-ai-body { padding: 14px 16px; font-size: 13.5px; line-height: 1.75; white-space: pre-wrap; }
.neo-ai-body.empty { color: var(--neo-text-faint); }
.neo-ai-foot { display: flex; gap: 8px; padding: 0 16px 14px; flex-wrap: wrap; }
.neo-ai-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #8b5cf6;
    animation: neo-blink 1s infinite; }
.neo-ai-dot:nth-child(2) { animation-delay: .2s; }
.neo-ai-dot:nth-child(3) { animation-delay: .4s; }
@keyframes neo-blink { 0%,100% { opacity: .25; } 50% { opacity: 1; } }

/* ---------- 标签页 / FAQ / 更新 / 相关（沿用站点 detail 风格的轻量版） ---------- */
.neo-tabs { display: flex; gap: 6px; margin: 26px 0 16px; border-bottom: 1px solid var(--neo-card-bd); flex-wrap: wrap; }
.neo-tab { border: 0; background: none; cursor: pointer; font-family: inherit; font-size: 14px; font-weight: 600;
    color: var(--neo-text-soft); padding: 10px 16px; position: relative; transition: color .18s; }
.neo-tab:hover { color: var(--neo-text); }
.neo-tab.active { color: var(--neo-accent); }
.neo-tab.active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 3px;
    border-radius: 3px 3px 0 0; background: var(--neo-grad); }
.neo-panel { display: none; background: var(--neo-surface); border: 1px solid var(--neo-card-bd);
    border-radius: var(--neo-radius); padding: 22px 24px; box-shadow: var(--neo-shadow); }
.neo-panel.active { display: block; animation: neo-fade .3s ease; }
@keyframes neo-fade { from { opacity: 0; } to { opacity: 1; } }
.neo-panel h2 { font-size: 17px; margin: 4px 0 12px; }
.neo-panel h2:not(:first-child) { margin-top: 22px; }
.neo-panel p, .neo-panel li { font-size: 14px; line-height: 1.8; color: var(--neo-text-soft); }
.neo-panel b { color: var(--neo-text); }

.neo-faq details { border: 1px solid var(--neo-card-bd); border-radius: 12px; padding: 0 16px; margin-bottom: 10px;
    background: var(--neo-surface-solid); }
[data-theme="dark"] .neo-faq details { background: rgba(255,255,255,.035); }
.neo-faq summary { cursor: pointer; font-size: 14px; font-weight: 600; padding: 13px 0; list-style: none; }
.neo-faq summary::-webkit-details-marker { display: none; }
.neo-faq summary::after { content: "＋"; float: right; color: var(--neo-accent); font-weight: 700; }
.neo-faq details[open] summary::after { content: "－"; }
.neo-faq .a { padding: 0 0 14px; font-size: 13.5px; line-height: 1.8; color: var(--neo-text-soft); }

.neo-timeline li { display: flex; gap: 12px; margin-bottom: 12px; align-items: baseline; }
.neo-timeline .ver { font-weight: 700; color: var(--neo-accent); flex: none; }
.neo-timeline .date { color: var(--neo-text-faint); font-size: 12.5px; flex: none; width: 82px; }
.neo-timeline .txt { font-size: 13.5px; color: var(--neo-text-soft); line-height: 1.7; }

.neo-related { margin-top: 24px; }
.neo-related h2 { font-size: 18px; margin-bottom: 14px; }
.neo-rel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.neo-rel {
    display: flex; align-items: center; gap: 11px; padding: 14px 16px;
    background: var(--neo-surface); border: 1px solid var(--neo-card-bd); border-radius: 14px;
    text-decoration: none; color: var(--neo-text); box-shadow: var(--neo-shadow);
    transition: transform .18s, border-color .18s;
}
.neo-rel:hover { transform: translateY(-3px); border-color: var(--neo-accent); }
.neo-rel .ri { font-size: 22px; }
.neo-rel b { font-size: 14px; display: block; }
.neo-rel small { font-size: 12px; color: var(--neo-text-faint); }

/* 面包屑 */
.neo-crumb { display: flex; gap: 8px; align-items: center; font-size: 13px; margin-bottom: 16px; color: var(--neo-text-faint); flex-wrap: wrap; }
.neo-crumb a { color: var(--neo-text-soft); text-decoration: none; }
.neo-crumb a:hover { color: var(--neo-accent); }
.neo-crumb .sep { opacity: .6; }

/* 通用工具类 */
.neo-mt { margin-top: 14px; }
.neo-mb { margin-bottom: 14px; }
.neo-mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.neo-hide { display: none !important; }
.neo-text-c { text-align: center; }
.neo-fs12 { font-size: 12px; }
.neo-faint { color: var(--neo-text-faint); }
.neo-soft { color: var(--neo-text-soft); }

/* 列表/表格（排班、候选结果等通用） */
.neo-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.neo-table th, .neo-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--neo-card-bd); }
.neo-table th { font-size: 12.5px; color: var(--neo-text-faint); font-weight: 600; background: color-mix(in srgb, var(--neo-accent) 6%, transparent); }
.neo-table tbody tr { cursor: pointer; transition: background .15s; }
.neo-table tbody tr:hover { background: color-mix(in srgb, var(--neo-accent) 8%, transparent); }
.neo-table tbody tr.picked { background: color-mix(in srgb, var(--neo-accent) 13%, transparent); }
.neo-table tbody tr.picked td:first-child { box-shadow: inset 3px 0 0 var(--neo-accent); }
.neo-scroll { overflow: auto; border: 1px solid var(--neo-card-bd); border-radius: 13px; }

/* toast */
.neo-toast {
    position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%) translateY(20px);
    background: rgba(15, 23, 42, .92); color: #fff; font-size: 13.5px;
    padding: 11px 20px; border-radius: 999px; opacity: 0; pointer-events: none;
    transition: all .28s; z-index: 9999; box-shadow: 0 12px 30px rgba(0,0,0,.3);
}
.neo-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
    .neo-layout { grid-template-columns: 1fr; }
    .neo-hero { padding: 24px 20px; }
    .neo-hero h1 { font-size: 21px; }
    .neo-grid3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
    .neo-grid2, .neo-grid3 { grid-template-columns: 1fr; }
    .neo-card { padding: 18px 16px; }
    .neo-hero-num .v { font-size: 32px; }
}

/* 打印：排班表 / 田字格 / 结果页通用 */
@media print {
    .neo-hero, .neo-btns, .neo-ai, .neo-tabs, .neo-related, .neo-crumb,
    .back-to-top, .neo-no-print { display: none !important; }
    .neo, .neo-card, .neo-panel { box-shadow: none !important; background: #fff !important;
        border-color: #ddd !important; backdrop-filter: none; animation: none; }
    .neo-layout { display: block; }
    body { background: #fff !important; }
}
