/**
 * 小说工作台 - 独立样式
 * v1.0.0: 首版 — 六阶段流水线 UI（步骤条/项目栏/模块卡/章节侧栏/审稿报告/去AI味逐条替换）
 */

body.nv-body {
    margin: 0;
    padding: 0;
    background: #0b0e14;
    color: #E6EAF2;
    font-family: "Space Grotesk", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    min-height: 100vh;
}
body.nv-body ::selection { background: rgba(79,227,193,.35); }

.nv-app {
    max-width: 1180px;
    margin: 0 auto;
    padding: 28px 24px 80px;
}

/* ===== 头部 ===== */
.nv-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 22px;
}
.nv-header h1 {
    margin: 0;
    font-size: 1.7rem;
    letter-spacing: .5px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.nv-ver-badge {
    font-size: .7rem;
    font-weight: 700;
    color: #06251f;
    background: #4FE3C1;
    border-radius: 6px;
    padding: 3px 8px;
    letter-spacing: 1px;
    vertical-align: 4px;
}
.nv-header-sub {
    margin: 6px 0 0;
    font-size: .82rem;
    color: #8B93A7;
}
.nv-project-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.nv-project-bar select {
    background: #131826;
    color: #E6EAF2;
    border: 1px solid #1F2735;
    border-radius: 10px;
    padding: 9px 12px;
    font-size: .85rem;
    min-width: 180px;
}
.nv-save-state { font-size: .78rem; color: #4FE3C1; min-width: 70px; }
.nv-save-state.saving { color: #fbbf24; }
.nv-save-state.error { color: #f87171; }

/* ===== 按钮 ===== */
.nv-btn {
    border: none;
    border-radius: 10px;
    padding: 10px 18px;
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    font-family: inherit;
}
.nv-btn:disabled { opacity: .5; cursor: not-allowed; }
.nv-btn-primary {
    background: #4FE3C1;
    color: #06251f;
}
.nv-btn-primary:hover:not(:disabled) { box-shadow: 0 0 22px rgba(79,227,193,.4); }
.nv-btn-ghost {
    background: transparent;
    border: 1px solid #1F2735;
    color: #E6EAF2;
}
.nv-btn-ghost:hover:not(:disabled) { border-color: #4FE3C1; color: #4FE3C1; }
.nv-btn-ghost.nv-danger:hover { border-color: #f87171; color: #f87171; }
.nv-btn-sm { padding: 5px 10px; font-size: .78rem; }
.nv-btn-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0; }

/* ===== 步骤条 ===== */
.nv-steps {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.nv-step {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #131826;
    border: 1px solid #1F2735;
    border-radius: 12px;
    padding: 10px 16px;
    color: #8B93A7;
    cursor: pointer;
    transition: all .2s;
    font-family: inherit;
    font-size: .88rem;
}
.nv-step-no {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #1F2735;
    color: #8B93A7;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 700;
}
.nv-step:hover { border-color: #2e3a52; color: #E6EAF2; }
.nv-step.is-active {
    background: rgba(79,227,193,.08);
    border-color: #4FE3C1;
    color: #4FE3C1;
}
.nv-step.is-active .nv-step-no { background: #4FE3C1; color: #06251f; }
.nv-step.is-done .nv-step-no { background: rgba(79,227,193,.25); color: #4FE3C1; }

/* ===== 阶段面板 ===== */
.nv-stage { display: none; }
.nv-stage.is-active { display: block; animation: nvFade .25s ease; }
@keyframes nvFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.nv-card {
    background: #10141f;
    border: 1px solid #1F2735;
    border-radius: 16px;
    padding: 22px;
    margin-bottom: 18px;
}
.nv-card-title { margin: 0 0 6px; font-size: 1.08rem; }
.nv-card-desc { margin: 0 0 16px; font-size: .82rem; color: #8B93A7; line-height: 1.6; }
.nv-hidden { display: none !important; }

/* ===== 表单 ===== */
.nv-form-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.nv-field { display: flex; flex-direction: column; gap: 6px; }
.nv-field.nv-grow { flex: 1 1 260px; }
.nv-field.nv-flex-end { justify-content: flex-end; }
.nv-field label { font-size: .78rem; color: #8B93A7; }
.nv-input, .nv-textarea {
    background: #131826;
    color: #E6EAF2;
    border: 1px solid #1F2735;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: .88rem;
    font-family: inherit;
    line-height: 1.7;
    width: 100%;
    box-sizing: border-box;
}
.nv-input:focus, .nv-textarea:focus { outline: none; border-color: #4FE3C1; }
.nv-textarea { resize: vertical; }
.nv-body-text { font-size: .92rem; line-height: 1.9; }
.nv-details { margin: 10px 0; }
.nv-details summary {
    cursor: pointer;
    font-size: .8rem;
    color: #8B93A7;
    user-select: none;
}
.nv-details summary:hover { color: #4FE3C1; }
.nv-details[open] summary { margin-bottom: 10px; }
.nv-context-preview {
    background: #0d1119;
    border: 1px dashed #1F2735;
    border-radius: 10px;
    padding: 12px;
    font-size: .75rem;
    color: #8B93A7;
    max-height: 220px;
    overflow: auto;
    white-space: pre-wrap;
    margin: 0 0 10px;
}
.nv-wr-meta { font-size: .78rem; color: #8B93A7; }

/* ===== 选题方案卡 ===== */
.nv-sel-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.nv-sel-card {
    background: #10141f;
    border: 1px solid #1F2735;
    border-radius: 16px;
    padding: 18px;
    display: flex;
    flex-direction: column;
}
.nv-sel-card h3 { margin: 0 0 10px; font-size: .98rem; color: #4FE3C1; }
.nv-sel-card .nv-sel-body { font-size: .82rem; line-height: 1.8; color: #B7BFCE; flex: 1; }
.nv-sel-card .nv-sel-body b { color: #E6EAF2; }
.nv-sel-card .nv-sel-body p { margin: 6px 0; }
.nv-sel-raw { white-space: pre-wrap; }

/* ===== 7 模块卡 ===== */
.nv-modules {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}
.nv-module {
    background: #10141f;
    border: 1px solid #1F2735;
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.nv-module-name { font-size: .88rem; font-weight: 600; }
.nv-module-status { font-size: .72rem; color: #8B93A7; }
.nv-module.is-doing { border-color: #fbbf24; }
.nv-module.is-doing .nv-module-status { color: #fbbf24; }
.nv-module.is-done { border-color: rgba(79,227,193,.5); }
.nv-module.is-done .nv-module-status { color: #4FE3C1; }

/* ===== Tabs ===== */
.nv-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.nv-tab {
    background: transparent;
    border: 1px solid #1F2735;
    border-radius: 9px;
    color: #8B93A7;
    padding: 7px 14px;
    cursor: pointer;
    font-size: .82rem;
    font-family: inherit;
    transition: all .2s;
}
.nv-tab.is-active { background: rgba(79,227,193,.08); border-color: #4FE3C1; color: #4FE3C1; }
.nv-tab-pane { display: none; }
.nv-tab-pane.is-active { display: block; }

/* ===== 表格 ===== */
.nv-table { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.nv-table th, .nv-table td {
    border: 1px solid #1F2735;
    padding: 8px 10px;
    font-size: .82rem;
    text-align: left;
}
.nv-table th { color: #8B93A7; font-weight: 600; background: #0d1119; }
.nv-table input, .nv-table select {
    background: #131826;
    color: #E6EAF2;
    border: 1px solid #1F2735;
    border-radius: 7px;
    padding: 6px 8px;
    font-size: .8rem;
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
}
.nv-table .nv-fsh-del {
    background: transparent;
    border: none;
    color: #f87171;
    cursor: pointer;
    font-size: 1rem;
}

/* ===== 章节侧栏 ===== */
.nv-stage-4-layout { display: flex; gap: 16px; align-items: flex-start; }
#nv-stage-4 { display: none; }
#nv-stage-4.is-active { display: flex; gap: 16px; align-items: flex-start; }
.nv-chapters {
    flex: 0 0 230px;
    background: #10141f;
    border: 1px solid #1F2735;
    border-radius: 16px;
    padding: 14px;
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 130px);
    overflow: auto;
}
.nv-chapters-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: .85rem;
    font-weight: 600;
    margin-bottom: 10px;
}
.nv-chapter-item {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 9px;
    padding: 8px 10px;
    color: #8B93A7;
    cursor: pointer;
    font-size: .82rem;
    font-family: inherit;
    transition: all .15s;
    margin-bottom: 2px;
}
.nv-chapter-item:hover { background: #131826; color: #E6EAF2; }
.nv-chapter-item.is-active { background: rgba(79,227,193,.08); border-color: #4FE3C1; color: #4FE3C1; }
.nv-chapter-item .nv-ch-flag { font-size: .68rem; margin-left: 6px; }
.nv-ch-flag.st-review { color: #fbbf24; }
.nv-ch-flag.st-deslop { color: #818cf8; }
.nv-ch-flag.st-final { color: #4FE3C1; }
.nv-write { flex: 1; min-width: 0; }
.nv-write .nv-card { margin-bottom: 0; }
.nv-ch-status { font-size: .78rem; color: #8B93A7; }

/* ===== 审稿报告 ===== */
.nv-rv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.nv-rv-card {
    background: #10141f;
    border: 1px solid #1F2735;
    border-radius: 16px;
    padding: 18px;
}
.nv-rv-card h3 { margin: 0 0 4px; font-size: .95rem; display: flex; align-items: center; justify-content: space-between; }
.nv-rv-score { font-size: .8rem; color: #4FE3C1; }
.nv-rv-score.warn { color: #fbbf24; }
.nv-rv-score.bad { color: #f87171; }
.nv-rv-issue {
    border-top: 1px dashed #1F2735;
    padding: 10px 0;
    font-size: .8rem;
    line-height: 1.7;
}
.nv-rv-issue .nv-lv {
    display: inline-block;
    font-size: .68rem;
    border-radius: 5px;
    padding: 1px 7px;
    margin-right: 6px;
    font-weight: 700;
}
.nv-lv-高 { background: rgba(248,113,113,.15); color: #f87171; }
.nv-lv-中 { background: rgba(251,191,36,.15); color: #fbbf24; }
.nv-lv-低 { background: rgba(139,147,167,.15); color: #8B93A7; }
.nv-rv-issue .nv-quote { display: block; color: #B7BFCE; background: #0d1119; border-left: 3px solid #1F2735; padding: 6px 10px; margin: 6px 0; border-radius: 0 8px 8px 0; }
.nv-rv-issue .nv-fix { color: #4FE3C1; }
.nv-rv-overall { margin-top: 14px; font-size: .85rem; line-height: 1.8; color: #B7BFCE; background: #0d1119; border-radius: 12px; padding: 14px; }

/* ===== 去 AI 味 ===== */
.nv-ds-summary {
    background: rgba(129,140,248,.08);
    border: 1px solid rgba(129,140,248,.35);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: .84rem;
    color: #B7BFCE;
    margin-top: 12px;
    line-height: 1.7;
}
.nv-ds-issues { display: flex; flex-direction: column; gap: 10px; }
.nv-ds-item {
    background: #10141f;
    border: 1px solid #1F2735;
    border-radius: 12px;
    padding: 14px 16px;
    font-size: .84rem;
    line-height: 1.8;
    transition: opacity .2s;
}
.nv-ds-item.is-ignored { opacity: .45; }
.nv-ds-item.is-applied { border-color: rgba(79,227,193,.5); }
.nv-ds-item-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.nv-ds-type {
    font-size: .72rem;
    font-weight: 700;
    color: #818cf8;
    background: rgba(129,140,248,.12);
    border-radius: 6px;
    padding: 2px 9px;
}
.nv-ds-cat { font-size: .7rem; color: #8B93A7; }
.nv-ds-orig { color: #f87171; background: #0d1119; border-left: 3px solid rgba(248,113,113,.5); padding: 6px 10px; border-radius: 0 8px 8px 0; margin: 6px 0; }
.nv-ds-fix { color: #4FE3C1; background: #0d1119; border-left: 3px solid rgba(79,227,193,.5); padding: 6px 10px; border-radius: 0 8px 8px 0; margin: 6px 0; }
.nv-ds-reason { color: #8B93A7; font-size: .76rem; }
.nv-ds-btns { margin-top: 8px; display: flex; gap: 8px; }
.nv-ds-btns .nv-btn { padding: 6px 14px; font-size: .78rem; }
.nv-ds-notfound { color: #fbbf24; font-size: .76rem; }
.nv-ds-state { font-size: .76rem; color: #4FE3C1; }

/* ===== Toast ===== */
.nv-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #131826;
    border: 1px solid #4FE3C1;
    color: #E6EAF2;
    border-radius: 12px;
    padding: 12px 22px;
    font-size: .85rem;
    opacity: 0;
    pointer-events: none;
    transition: all .25s;
    z-index: 10000;
    max-width: 80vw;
}
.nv-toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }
.nv-toast.err { border-color: #f87171; }

/* ===== 加载中 ===== */
.nv-loading { display: inline-block; }
.nv-btn.is-loading { position: relative; color: transparent !important; }
.nv-btn.is-loading::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(6,37,31,.3);
    border-top-color: #06251f;
    border-radius: 50%;
    animation: nvSpin .7s linear infinite;
}
@keyframes nvSpin { to { transform: rotate(360deg); } }

@media (max-width: 760px) {
    .nv-app { padding: 18px 14px 60px; }
    .nv-chapters { position: static; flex: 1 1 100%; max-height: 220px; }
    #nv-stage-4.is-active { flex-direction: column; }
}
