* { box-sizing: border-box; }
body { margin: 0; font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
       background: #f5f6f8; color: #1f2329; font-size: 14px; }
.hidden { display: none !important; }

/* 登录 */
.login-wrap { height: 100vh; display: flex; align-items: center; justify-content: center;
              background: linear-gradient(135deg, #eef2f7, #f7f8fa); }
.login-card { background: #fff; padding: 40px 36px; border-radius: 12px; width: 380px;
              box-shadow: 0 8px 32px rgba(31,35,41,.10); }
.login-card h1 { font-size: 20px; margin: 0 0 6px; }
.login-card .sub { color: #8a9099; margin: 0 0 24px; font-size: 12px; }
.login-card input { width: 100%; padding: 10px 12px; margin-bottom: 12px; border: 1px solid #d8dce3;
                    border-radius: 6px; font-size: 14px; }
.login-card button { width: 100%; padding: 10px; background: #2b5cff; color: #fff; border: 0;
                     border-radius: 6px; font-size: 15px; cursor: pointer; }
.login-card .hint { margin-top: 16px; font-size: 12px; color: #8a9099; line-height: 1.7; }
.login-card .hint .acclink { display: inline-block; margin-top: 8px; color: #2f6fb5; text-decoration: none;
  border-bottom: 1px dashed #9dbde0; padding-bottom: 1px; }
.login-card .hint .acclink:hover { color: #1b4f8c; border-bottom-style: solid; }
.err { color: #d03050; font-size: 12px; margin-top: 8px; }
.scope-tip { background: #eef4fc; border: 1px solid #cfe0f5; color: #2c5c94; font-size: 12px;
  line-height: 1.6; padding: 6px 10px; border-radius: 4px; margin-bottom: 10px; }

/* 框架 */
header { height: 56px; background: #fff; border-bottom: 1px solid #e6e8eb; display: flex;
         align-items: center; justify-content: space-between; padding: 0 20px; }
.brand { font-size: 16px; font-weight: 600; }
.user { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #4e5969; }
button { padding: 6px 14px; background: #2b5cff; color: #fff; border: 0; border-radius: 6px;
         cursor: pointer; font-size: 13px; }
button.ghost { background: #fff; color: #4e5969; border: 1px solid #d8dce3; }
button.ghost:hover { background: #f2f3f5; }
button.danger { background: #fff; color: #d03050; border: 1px solid #f0b4bf; }
.body { display: flex; height: calc(100vh - 56px); }
nav { width: 200px; background: #fff; border-right: 1px solid #e6e8eb; padding: 12px 0; overflow: auto; }
nav .group { padding: 8px 16px; font-size: 12px; color: #8a9099; }
nav a { display: block; padding: 9px 16px; color: #1f2329; text-decoration: none; font-size: 13px;
        cursor: pointer; border-left: 3px solid transparent; }
nav a:hover { background: #f2f3f5; }
nav a.active { background: #eef3ff; color: #2b5cff; border-left-color: #2b5cff; }
main { flex: 1; padding: 20px; overflow: auto; }
.empty { color: #8a9099; padding: 40px; text-align: center; }
/* 表格里可下钻的维度名（点名称同「看明细」） */
a.drill { color: #2b5cff; cursor: pointer; text-decoration: none; border-bottom: 1px dotted #2b5cff; }
a.drill:hover { background: #eef3ff; }

/* 表格 */
.toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.toolbar h2 { font-size: 16px; margin: 0; }
.tag { font-size: 12px; color: #8a9099; margin-left: 8px; }
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden;
        box-shadow: 0 1px 3px rgba(31,35,41,.06); }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid #f0f1f3; font-size: 13px; }
th { background: #fafbfc; color: #4e5969; font-weight: 600; white-space: nowrap; }
td.num, th.num { text-align: right; }
tr:hover td { background: #fafbfc; }
/* 底部合计行 */
tfoot td { background: #eef3ff; font-weight: 700; color: #2b5cff; border-top: 2px solid #d6e0ff;
           border-bottom: none; font-variant-numeric: tabular-nums; }
/* 自动计算列（公式/lookup，只读） */
th.auto, td.auto { background: #f7f9fc; color: #4e5969; }
tr:hover td.auto { background: #f2f5fa; }
.auto-tag { font-size: 11px; color: #8a9099; font-weight: 400; }
/* 列多时表格横向滚动（月份列全量展示） */
.tblwrap { overflow-x: auto; }
.tblwrap table { min-width: max-content; width: 100%; }
.ops { white-space: nowrap; }

/* 卡片 */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.card { background: #fff; border-radius: 8px; padding: 16px; box-shadow: 0 1px 3px rgba(31,35,41,.06); }
.card .label { font-size: 12px; color: #8a9099; }
.card .value { font-size: 22px; font-weight: 600; margin-top: 6px; }
.card .sub { font-size: 12px; color: #8a9099; margin-top: 4px; }
.pos { color: #d03050; }  /* 涨/正：红 */
.neg { color: #00a870; }

/* 利润表 */
.pl-table { background: #fff; border-radius: 8px; padding: 8px 0; box-shadow: 0 1px 3px rgba(31,35,41,.06); }
.pl-table .row { display: flex; justify-content: space-between; padding: 9px 20px; font-size: 13px; }
.pl-table .row.subtotal { background: #f7f9fc; font-weight: 600; }
.pl-table .row.total { background: #eef3ff; font-weight: 700; color: #2b5cff; }
.pl-table .row .amt { font-variant-numeric: tabular-nums; }

/* 损益科目树（逐级折叠） */
.sechead { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 6px; }
.sechead h3.sec { margin: 0; }
.sechead button { margin-left: 8px; }
.pl-tree { background: #fff; border-radius: 8px; padding: 4px 0;
           box-shadow: 0 1px 3px rgba(31,35,41,.06); }
.plnode { display: flex; align-items: center; gap: 6px; padding: 7px 16px;
          font-size: 13px; border-top: 1px solid #f4f5f7; }
.plnode:first-child { border-top: 0; }
.plnode.has { cursor: pointer; }
.plnode.has:hover { background: #f7f9fc; }
.plnode.lv0 { font-weight: 500; background: #fafbfc; }
.plnode.lv0:hover { background: #f2f6ff; }
.plnode .caret { flex: 0 0 14px; font-size: 10px; color: #8a9099; text-align: center; }
.plnode .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plnode .nm em { font-style: normal; color: #9aa0a8; font-size: 11px; margin-right: 8px;
                 font-variant-numeric: tabular-nums; }
.plnode .amt { font-variant-numeric: tabular-nums; color: #1f2329; }
.pl-sum { background: #eef3ff; border-radius: 8px; padding: 4px 0; margin-top: 10px; }
.pl-sum .row { display: flex; justify-content: space-between; padding: 8px 20px; font-size: 13px; }
.pl-sum .row.subtotal { background: #f7f9fc; font-weight: 600; }
.pl-sum .row.total { font-weight: 700; color: #2b5cff; }
.negv { color: #d03050; }

/* 弹窗 */
.modal { position: fixed; inset: 0; background: rgba(31,35,41,.45); display: flex;
         align-items: center; justify-content: center; z-index: 20; }
.modal-card { background: #fff; border-radius: 10px; padding: 24px; width: 620px; max-height: 80vh;
              overflow: auto; }
.modal-card h3 { margin: 0 0 16px; font-size: 16px; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form label { font-size: 12px; color: #4e5969; display: block; margin-bottom: 4px; }
.form input, .form select { width: 100%; padding: 7px 10px; border: 1px solid #d8dce3; border-radius: 6px;
                            font-size: 13px; }
/* 关键字联想输入（替代原生下拉） */
.form .combo { position: relative; }
.combo-list { position: absolute; z-index: 30; top: 100%; left: 0; right: 0; margin-top: 2px;
              background: #fff; border: 1px solid #d8dce3; border-radius: 6px; max-height: 220px;
              overflow-y: auto; box-shadow: 0 6px 18px rgba(31,35,41,.14); }
.combo-item { padding: 6px 10px; font-size: 13px; cursor: pointer;
              white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.combo-item:hover { background: #f2f6ff; }
.combo-item.active { background: #e8f3ff; color: #2b5cff; }
.combo-item b { color: #2b5cff; font-weight: 600; }
.combo-empty { padding: 6px 10px; font-size: 12px; color: #8a9099; }
.combo-in.bad { border-color: #d03050 !important; background: #fff6f7; }

.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

.modal-card.wide { width: 900px; }

/* 导入预览 */
.imp-drop { border: 1px dashed #c9cdd4; border-radius: 8px; padding: 18px; text-align: center;
            background: #fafbfc; color: #4e5969; font-size: 13px; }
.imp-stat { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0 10px; }
.imp-stat span { background: #f2f3f5; border-radius: 4px; padding: 4px 10px; font-size: 12px; color: #4e5969; }
.imp-stat span.bad { background: #fdeff2; color: #d03050; }
.imp-stat span.ok { background: #eaf7f1; color: #00a870; }
.imp-wrap { max-height: 46vh; overflow: auto; border: 1px solid #e6e8eb; border-radius: 6px; }
.imp-wrap table { box-shadow: none; border-radius: 0; }
.imp-wrap td.err { color: #d03050; font-size: 12px; }
.imp-wrap tr.bad td { background: #fdeff2; }
.imp-mode { font-size: 11px; padding: 1px 6px; border-radius: 3px; background: #eef3ff; color: #2b5cff; }
.imp-mode.upd { background: #fff4e6; color: #a15c00; }

.note { background: #fff8e6; border: 1px solid #ffe0a3; padding: 10px 14px; border-radius: 6px;
        font-size: 12px; color: #8a5a00; margin-bottom: 12px; line-height: 1.7; }
.warn { background: #eef3ff; border: 1px solid #c7d7ff; padding: 10px 14px; border-radius: 6px;
        font-size: 12px; color: #2b5cff; margin-bottom: 12px; }

/* 审批流转 */
.apbar { display: flex; align-items: center; gap: 12px; background: #f7f8fa; border: 1px solid #e6e8eb;
         border-radius: 6px; padding: 8px 12px; margin-bottom: 12px; }
.apbar .sub { font-size: 12px; color: #86909c; }
span.st { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
span.st.s-draft { background: #f2f3f5; color: #4e5969; }
span.st.s-wait  { background: #fff4e6; color: #a15c00; }
span.st.s-ok    { background: #eaf7f1; color: #00a870; }
span.st.s-rej   { background: #fdeff2; color: #d03050; }
.logrow { padding: 8px 12px; border-bottom: 1px solid #f0f1f3; font-size: 12px; color: #4e5969; line-height: 1.7; }
.logrow b { color: #1f2329; font-weight: 600; }

/* 税金测算：月度条 */
h3.sec { font-size: 14px; margin: 18px 0 8px; color: #1f2329; border-left: 3px solid #2b5cff;
         padding-left: 8px; }
td.months { white-space: normal; min-width: 460px; }
td.months .mm { display: inline-block; margin: 1px 6px 1px 0; font-size: 11px; color: #4e5969;
                background: #f5f6f8; border-radius: 4px; padding: 2px 6px;
                font-variant-numeric: tabular-nums; }
td.months .mm b { color: #8a9099; font-weight: 500; margin-right: 4px; }
/* 税金测算：单元格里的「当前值」小字 */
td .sub { font-size: 11px; color: #8a9099; font-weight: 400;
          font-variant-numeric: tabular-nums; margin-top: 2px; }
td .sub .warn { color: #d9822b; }
.legal-group td { font-weight: 600; }
