/* 板材云排版生产系统 - 桌面软件风格 */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --blue: #2f7fd6;
    --blue-dark: #1f5fa8;
    --line: #c9d7ea;
    --head-bg: #dce8f7;
    --bg: #eef3fa;
    --text: #1e293b;
    --muted: #5b6b80;
}

body {
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    font-size: 13px;
    color: var(--text);
    background: var(--bg);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* 标题栏 */
.titlebar {
    background: linear-gradient(#3d8ae0, #2470c8);
    color: #fff;
    padding: 6px 12px;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.app-name { font-weight: 600; }
.app-tag { font-size: 11px; opacity: .85; }

/* 菜单栏 */
.menubar {
    background: linear-gradient(#f4f8fd, #dde8f6);
    border-bottom: 1px solid var(--line);
    padding: 0 6px;
    display: flex;
    user-select: none;
}
.menu { position: relative; }
.menu-title {
    display: inline-block;
    padding: 5px 12px;
    cursor: default;
}
.menu:hover .menu-title { background: #cfe2f7; }
.menu-drop {
    display: none;
    position: absolute;
    top: 100%; left: 0;
    min-width: 150px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: 2px 2px 6px rgba(0,0,0,.15);
    z-index: 50;
}
.menu:hover .menu-drop { display: block; }
.menu-drop a {
    display: block;
    padding: 7px 14px;
    cursor: pointer;
    color: var(--text);
}
.menu-drop a:hover { background: #e3eefb; }

/* 菜单并入工具栏（与工具按钮同风格） */
.toolbar .menu { display: flex; align-items: stretch; position: relative; }
.toolbar .menu .menu-title { user-select: none; }
.toolbar .menu:hover .menu-title { background: #d5e6fa; border-color: #a9c8ee; }

/* 工具栏 */
.toolbar {
    background: linear-gradient(#f7fafd, #e3edf9);
    border-bottom: 1px solid var(--line);
    padding: 4px 8px;
    display: flex;
    align-items: stretch;
    gap: 4px;
    flex-wrap: wrap;
}
.tb-group { display: flex; gap: 2px; }
.tb-sep { width: 1px; background: var(--line); margin: 2px 6px; }
.tb {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    padding: 4px 8px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    color: var(--text);
}
.tb i { font-style: normal; font-size: 17px; margin-bottom: 2px; }
.tb:hover { background: #d5e6fa; border-color: #a9c8ee; }
.tb.accent { background: #dceaff; border-color: #a9c8ee; font-weight: 600; }
.tb-right { margin-left: auto; display: flex; align-items: stretch; }

/* 右上角实时时钟 */
.tb-clock {
    align-self: center;
    padding: 0 12px;
    font-size: 13px;
    font-weight: 600;
    color: #1d4e89;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* 工具栏挤向快捷选择 */
.tb-select {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 74px;
    padding: 2px 6px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 11px;
    color: var(--muted);
}
.tb-select:hover { background: #d5e6fa; border-color: #a9c8ee; }
.tb-select select {
    margin-top: 2px;
    font-size: 12px;
    border: 1px solid var(--line);
    border-radius: 3px;
    background: #fff;
    padding: 1px 2px;
}

/* 主区：左右分栏（撑满高度） */
.main {
    flex: 1;
    overflow: hidden;
    padding: 8px;
}
.panes { display: flex; gap: 8px; align-items: stretch; height: 100%; }
.pane-grid { flex: 0 0 auto; max-width: 46%; min-width: 0;
    display: flex; flex-direction: column; }
.pane-res { flex: 1; min-width: 0; overflow: auto; }

.grid-head {
    background: linear-gradient(#eaf2fc, #d8e6f7);
    border: 1px solid var(--line);
    border-bottom: none;
    padding: 5px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.grid-title { font-weight: 700; color: #1d4e89; font-size: 14px; }
.grid-area {
    font-size: 13px;
    color: #2f7fd6;
    background: #e8f2fd;
    border: 1px solid #b8d4f0;
    border-radius: 4px;
    padding: 2px 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.mini {
    padding: 3px 10px;
    font-size: 12px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 3px;
    cursor: pointer;
}
.mini:hover { border-color: var(--blue); color: var(--blue); }

/* 表格：列宽压缩到刚好显示文字，高度撑到底部 */
.grid-wrap {
    border: 1px solid var(--line);
    background: #fff;
    flex: 1;
    overflow: auto;
}
#grid { border-collapse: collapse; width: auto; table-layout: auto; }
#grid th {
    background: var(--head-bg);
    border: 1px solid var(--line);
    padding: 5px 6px;
    font-size: 12px;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
}
#grid td {
    border: 1px solid #e3ebf6;
    padding: 0;
    white-space: nowrap;
}
#grid td.idx {
    text-align: center;
    color: var(--muted);
    background: #f4f8fd;
    font-size: 11px;
    min-width: 34px;
}
#grid td.ops { text-align: center; background: #f4f8fd; }
#grid td input, #grid td select.grain-sel {
    width: 100%;
    min-width: 0;
    border: none;
    padding: 5px 6px;
    font-size: 13px;
    background: transparent;
    font-family: inherit;
}
#grid td input:focus { outline: none; background: #fff8dc; }
#grid tr:hover td { background: #f2f7fe; }
.row-del {
    border: none; background: none; color: #c33;
    cursor: pointer; font-size: 13px; padding: 2px 6px;
}

/* 结果区 */
#results { margin-top: 10px; }
.res-head {
    background: linear-gradient(#eaf2fc, #d8e6f7);
    border: 1px solid var(--line);
    padding: 5px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
#resSummary { font-size: 12px; color: var(--muted); }
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
    margin: 8px 0;
}
.stat {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 10px;
    text-align: center;
}
.stat-label { font-size: 11px; color: var(--muted); }
.stat-value { font-size: 20px; font-weight: 700; color: var(--blue); margin-top: 4px; }
.stat-sub { font-size: 10px; color: var(--muted); }

.warnbox {
    background: #fff7ed;
    border: 1px solid #fdba74;
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 8px;
    color: #9a3412;
    font-size: 12px;
    line-height: 1.8;
}

/* 结果区 - 缩略图网格（一屏显示全部排版结果） */
#sheets {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 8px;
}
.sheet-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow .15s, border-color .15s;
}
.sheet-card:hover { border-color: var(--blue); box-shadow: 0 2px 10px rgba(47,127,214,.18); }
.sheet-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border-bottom: 1px solid var(--line);
    background: #f4f8fd;
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
}
.sheet-head b { color: var(--text); }
.grp {
    background: #dceaff;
    color: #1d4e89;
    border-radius: 4px;
    padding: 0 6px;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sheet-head .util { margin-left: auto; color: var(--blue); font-weight: 600; }
.bsize {
    background: #dceaff;
    color: #1d4e89;
    border: 1.5px solid #2f7fd6;
    border-radius: 4px;
    padding: 1px 8px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
}
.sheet-body { padding: 4px; }
.sheet-body svg { width: 100%; height: auto; display: block; }
.sheet-modal-body svg { width: 100%; max-height: 62vh; height: auto; display: block;
    touch-action: none; user-select: none; }
.sheet-modal-body g.part { cursor: grab; }
.sheet-modal-body g.part.dragging { cursor: grabbing; opacity: .88; }

/* 状态栏 */
.statusbar {
    background: linear-gradient(#f4f8fd, #dde8f6);
    border-top: 1px solid var(--line);
    padding: 4px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--muted);
}
.status-left-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 弹窗 */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 30, 50, .35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}
.modal[hidden] { display: none !important; }
.modal-box {
    background: #fff;
    border-radius: 8px;
    width: 420px;
    max-width: 94vw;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0,0,0,.25);
}
.modal-box.wide { width: 860px; }
.modal-title {
    padding: 12px 16px;
    font-weight: 700;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(#eaf2fc, #d8e6f7);
    border-radius: 8px 8px 0 0;
}
.ipf-right-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.ipf-right-head .ipf-panel-title { margin-bottom: 0; }
.imp-skip-first {
    display: flex; align-items: center; gap: 5px; flex: none;
    font-weight: 600; font-size: 13px; color: var(--accent, #3b82f6);
    cursor: pointer; user-select: none;
}
.imp-skip-first input { cursor: pointer; }
.modal-body { padding: 14px 16px; overflow: auto; }
.modal-foot {
    padding: 10px 16px;
    border-top: 1px solid var(--line);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    align-items: center;
}
.modal-foot .spacer { flex: 1; }
.foot-sel {
    padding: 7px 8px;
    border: 1px solid var(--blue);
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    color: #1d4e89;
    background: #eaf2fc;
    max-width: 220px;
}

/* 表单 */
.field { display: block; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.field input, .field select {
    display: block;
    width: 100%;
    margin-top: 3px;
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: 4px;
    font-size: 13px;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--blue); }
textarea.nc-code {
    display: block;
    width: 100%;
    margin-top: 3px;
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: 4px;
    font-family: Consolas, monospace;
    font-size: 12px;
    resize: vertical;
}
textarea.nc-code:focus { outline: none; border-color: var(--blue); }

/* NC 设备档案栏 */
.dev-bar { display: flex; gap: 6px; margin-bottom: 4px; align-items: center; }
.dev-bar select {
    flex: 1;
    padding: 7px 8px;
    border: 1px solid var(--blue);
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    color: #1d4e89;
    background: #eaf2fc;
}
.dev-info {
    background: #f4f8fd;
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 7px 10px;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 10px;
}
.row { display: flex; gap: 10px; }
.row .field { flex: 1; }
.hidden { display: none; }
.chkline { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-bottom: 10px; }
.radio { font-size: 12px; color: var(--muted); }

.btn {
    padding: 7px 20px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
}
.btn:hover { border-color: var(--blue); color: var(--blue); }
.btn-primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn-primary:hover { background: var(--blue-dark); color: #fff; }

/* 导入向导 */
.imp-scroll { max-height: 45vh; overflow: auto; border: 1px solid var(--line); }
.imp-table { border-collapse: collapse; width: 100%; }
.imp-table th, .imp-table td {
    border: 1px solid #e3ebf6;
    padding: 4px 6px;
    font-size: 12px;
    white-space: nowrap;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.imp-table th { background: var(--head-bg); position: sticky; top: 0; }
.imp-table th select { width: 110px; font-size: 12px; }
.imp-table tr.header-row td { background: #fff8dc; font-weight: 600; }
.imp-hint { font-size: 12px; color: var(--muted); margin-top: 8px; line-height: 1.7; }

/* 导入设置（层级：左=导入名称，右=列映射） */
.ipf-wrap { display: flex; gap: 14px; min-height: 340px; }
.ipf-left  { width: 260px; flex: none; border: 1px solid var(--line); border-radius: 6px; padding: 10px; display: flex; flex-direction: column; }
.ipf-right { flex: 1; border: 1px solid var(--line); border-radius: 6px; padding: 10px; display: flex; flex-direction: column; min-width: 0; }
.ipf-panel-title { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 8px; }

.ipfl-list { flex: 1; overflow: auto; }
.ipfl-item {
    display: flex; align-items: center; gap: 6px;
    padding: 6px; border-radius: 6px; cursor: pointer;
    border: 1px solid transparent; margin-bottom: 4px;
}
.ipfl-item:hover { background: var(--head-bg); }
.ipfl-item.ipfl-editing { background: #eef4ff; border-color: var(--accent, #3b82f6); }
.ipfl-radio { flex: none; margin: 0; cursor: pointer; }
.ipfl-name { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 4px; padding: 4px 6px; font-size: 13px; }
.ipfl-del  { flex: none; border: none; background: none; color: #c0392b; cursor: pointer; font-size: 14px; padding: 2px 6px; border-radius: 4px; }
.ipfl-del:hover { background: #fde8e8; }

.ipf-add { display: flex; gap: 6px; margin-top: 8px; }
.ipf-add input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 4px; padding: 5px 8px; font-size: 13px; }

.ipc-hint { font-size: 12px; color: var(--muted); margin-bottom: 8px; line-height: 1.6; }
.ipc-list { flex: 1; overflow: auto; }
.ipc-row {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 8px; border: 1px solid #e3ebf6; border-radius: 6px; margin-bottom: 5px;
}
.ipc-idx { flex: none; width: 52px; font-weight: 600; font-size: 12px; color: var(--muted); font-family: monospace; }
.ipc-field { flex: 1; font-size: 13px; color: var(--ink); }
.ipc-field.ipc-empty { color: #bbb; font-style: italic; }
.ipc-pick { flex: none; border: 1px solid var(--accent, #3b82f6); background: #fff; color: var(--accent, #3b82f6); cursor: pointer; font-size: 12px; padding: 3px 12px; border-radius: 4px; }
.ipc-pick:hover { background: #eef4ff; }
.ipc-del-col { flex: none; border: 1px solid var(--line); background: #fff; color: #c0392b; cursor: pointer; font-size: 14px; line-height: 1; padding: 3px 9px; border-radius: 4px; }
.ipc-del-col:hover { background: #fde8e8; }

/* 字段拣选子窗口 */
.fpk-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; max-height: 50vh; overflow: auto; }
.fpk-opt {
    border: 1px solid var(--line); background: #fff; cursor: pointer;
    font-size: 13px; padding: 10px 8px; border-radius: 6px; text-align: center;
}
.fpk-opt:hover { background: var(--head-bg); border-color: var(--accent, #3b82f6); }
.fpk-opt.fpk-selected { background: var(--accent, #3b82f6); color: #fff; border-color: var(--accent, #3b82f6); }

/* 列设置 */
.col-list { list-style: none; }
.col-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 4px;
    border-bottom: 1px solid #eef2f8;
    font-size: 13px;
}
.col-list .col-mv { margin-left: auto; display: flex; gap: 4px; }
.col-list .col-mv button {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 3px;
    cursor: pointer;
    padding: 1px 8px;
}
.col-note { font-size: 11px; color: var(--muted); }

.help-body p { margin-bottom: 10px; line-height: 1.8; font-size: 13px; }

/* 标签设置弹窗 */
.label-settings { display: flex; gap: 18px; }
.ls-left { flex: 1; min-width: 0; }
.ls-right { width: 380px; flex-shrink: 0; }
.lbl-fields {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px 12px;
    font-size: 13px;
}
.lbl-fields li { padding: 3px 0; }
.ls-stage {
    width: 100%;
    height: 400px;
    background: #dde4ee;
    border: 1px solid var(--line);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.ls-scale { flex-shrink: 0; background: #fff; box-shadow: 0 3px 16px rgba(0,0,0,.28); }
.ls-inner { transform-origin: top left; }

/* 打印样式（样图/标签窗口内联使用） */
@media print {
    body { overflow: visible; }
}

/* 窄屏适配 */
@media (max-width: 900px) {
    .panes { flex-direction: column; }
    .pane-grid { max-width: 100%; width: 100%; }
}

/* 右侧空白区：品牌艺术字背景 */
.empty {
    height: 100%;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px dashed var(--line);
    border-radius: 8px;
    overflow: hidden;
}
.empty-brand { text-align: center; user-select: none; padding: 20px; }
.empty-brand .b1 {
    font-size: 84px;
    font-weight: 900;
    letter-spacing: 16px;
    background: linear-gradient(160deg, #1d4e89 10%, #2f7fd6 55%, #9cc3ee 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    opacity: .30;
    white-space: nowrap;
}
.empty-brand .b2 {
    margin-top: 26px;
    font-size: 34px;
    font-weight: 700;
    letter-spacing: 6px;
    color: #2f7fd6;
    opacity: .38;
}
.empty-brand .b3 {
    margin-top: 46px;
    font-size: 14px;
    color: var(--muted);
    letter-spacing: 2px;
}

.empty[hidden] { display: none !important; }

.tb-clock.warn { color: #c2410c; }

/* 材料设置 */
.board-list { list-style: none; }
.board-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 4px;
    border-bottom: 1px solid #eef2f8;
}
.board-list li .bv { flex: 1; text-align: center; }
.board-list li input[type="number"] { width: 80px; padding: 4px; border:1px solid var(--line); border-radius:4px; text-align:center; }
.board-list li .b-area { font-size:11px; color:var(--muted); min-width:70px; text-align:right; }
.board-list li .b-pri { font-size:11px; color:var(--blue); min-width:100px; text-align:right; }

/* 材料库两级树状UI */
.m-cat-group { margin-bottom: 4px; border: 1px solid #dce8f7; border-radius: 4px; overflow: hidden; }
.m-cat-head {
    display: flex; align-items: center; gap: 6px;
    background: #dce8f7; padding: 5px 8px; cursor: default;
}
.m-cat-label { font-weight: 600; flex: 1; font-size: 13px; }
.m-toggle { cursor: pointer; min-width: 22px; }
.m-cat-body { padding: 0 8px 6px; }
.m-item-header {
    display: flex; align-items: center; gap: 6px;
    font-size: 11px; color: var(--muted);
    padding: 4px 0 2px; border-bottom: 1px solid #eef2f8;
}
.m-item-header span { min-width: 46px; }
.m-item {
    display: flex; align-items: center; gap: 6px;
    padding: 4px 0; border-bottom: 1px solid #f4f7fc;
    font-size: 12px;
}
.m-item input[type="text"]   { padding: 2px 4px; border: 1px solid var(--line); border-radius: 3px; font-size: 12px; }
.m-item input[type="number"] { padding: 2px 4px; border: 1px solid var(--line); border-radius: 3px; text-align: center; font-size: 12px; }
.m-item select { padding: 2px 2px; border: 1px solid var(--line); border-radius: 3px; font-size: 12px; }
.m-toggle-rem { font-size: 11px; white-space: nowrap; }
.m-del-item   { font-size: 11px; }

/* 刀具库两级树状UI */
.t-grp-block { margin-bottom: 4px; border: 1px solid #dce8f7; border-radius: 4px; overflow: hidden; }
.t-grp-head  {
    display: flex; align-items: center; gap: 6px;
    background: #e8f0fa; padding: 5px 8px;
}
.t-grp-label { font-weight: 600; flex: 1; font-size: 13px; }
.t-grp-body  { padding: 0 8px 6px; overflow-x: auto; }
.t-item-hdr  {
    display: flex; align-items: center; gap: 4px;
    font-size: 11px; color: var(--muted);
    padding: 4px 0 2px; border-bottom: 1px solid #eef2f8;
    white-space: nowrap;
}
.t-item-hdr span { min-width: 42px; }
.t-sel-col   { min-width: 20px; flex-shrink: 0; }
.t-item      {
    display: flex; align-items: center; gap: 4px;
    padding: 4px 0; border-bottom: 1px solid #f4f7fc;
    font-size: 12px; white-space: nowrap;
}
.t-item.t-active { background: #f0f8ff; border-radius: 3px; }
.t-item input[type="text"]   { padding: 2px 4px; border: 1px solid var(--line); border-radius: 3px; font-size: 12px; }
.t-item input[type="number"] { padding: 2px 4px; border: 1px solid var(--line); border-radius: 3px; text-align: center; font-size: 12px; }
.t-del-tool  { font-size: 11px; flex-shrink: 0; }

/* ========== Toast 提示 ========== */
#appToast {
    position: fixed;
    bottom: 36px;
    right: 36px;
    background: #1a7a3a;
    color: #fff;
    padding: 13px 22px;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 4px 18px rgba(0,0,0,.28);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .28s ease, transform .28s ease;
    pointer-events: none;
    z-index: 9999;
    max-width: 340px;
    white-space: pre-wrap;
}
#appToast.show {
    opacity: 1;
    transform: translateY(0);
}

/* ========== NC 保存位置行 ========== */
.nc-folder-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0 2px;
}
.nc-folder-lbl {
    flex-shrink: 0;
    font-size: 13px;
    color: #888;
    white-space: nowrap;
}
.nc-folder-path {
    flex: 1;
    font-size: 13px;
    color: #333;
    background: #f5f5f5;
    border-radius: 4px;
    padding: 3px 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* ========== NC 文件名确认列表 ========== */
.ncn-list { max-height: 46vh; overflow-y: auto; }
.ncn-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.ncn-row .ncn-tag {
    flex-shrink: 0;
    width: 44px;
    font-size: 12px;
    color: #2f7fd6;
    font-weight: 600;
}
.ncn-row input {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: 4px;
    font-size: 13px;
}
.ncn-row .ncn-ext {
    flex-shrink: 0;
    font-size: 13px;
    color: #888;
}

/* ==================== 授权 / 账号 ==================== */
.lic-logo { margin: 0; font-size: 16px; }

.lic-hint {
    font-size: 13px;
    color: #555;
    line-height: 1.7;
    margin: 0;
}

.lic-msg {
    min-height: 20px;
    font-size: 13px;
    margin: 8px 0 0;
    color: #27ae60;
}
.lic-msg.lic-msg-err { color: #c0392b; }

/* 授权弹窗永远在最顶层，盖住所有内容 */
#licModal { z-index: 9999; }

.acct-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 7px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
}
.acct-row:last-child { border-bottom: none; }
.acct-lbl {
    flex-shrink: 0;
    width: 56px;
    color: #888;
    font-size: 12px;
}

/* 账号信息卡片——右上角定位小弹出框，非全屏遮罩 */
#acctModal {
    position: fixed;
    top: 44px;
    right: 8px;
    width: 258px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e0e6ef;
    box-shadow: 0 6px 24px rgba(0,0,0,.18), 0 1px 4px rgba(0,0,0,.06);
    z-index: 300;
    overflow: hidden;
}
#acctModal[hidden] { display: none !important; }
/* 小三角指向右上角用户按钮 */
#acctModal::before {
    content: '';
    position: absolute;
    top: -7px;
    right: 20px;
    border: 7px solid transparent;
    border-top: none;
    border-bottom-color: #e0e6ef;
}
#acctModal::after {
    content: '';
    position: absolute;
    top: -6px;
    right: 21px;
    border: 6px solid transparent;
    border-top: none;
    border-bottom-color: #fff;
}
.acct-popup-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px 9px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
    font-weight: 700;
    color: #333;
    background: #fafbfc;
}
.acct-popup-body { padding: 2px 14px 6px; }
.acct-popup-foot {
    padding: 8px 14px 10px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: flex-end;
}

/* 工具栏账号按钮状态 */
#userBtn.lic-ok { color: #27ae60; }
#userBtn.lic-exp { color: #e67e22; }

/* 危险轮廓按钮（注销授权） */
.danger-outline-btn {
    color: #c0392b;
    background: transparent;
    border: 1px solid #c0392b;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
}
.danger-outline-btn:hover { background: #fdf0ef; }

