/* ============================================================
 * 壹圆|PSI 公共样式层 layout.css
 * 全站 14 个页面共用：布局 / 侧边栏 / 顶栏 / 卡片 / 按钮 / 表格 / 弹窗 / toast / 登录层
 * 页面独有样式保留在各页面内联 <style>（本文件之后加载，同特异性时后者生效）
 * 改全局 UI 只动本文件
 * ============================================================ */
@import url("theme.css?v=20260913a");
* { margin:0; padding:0; box-sizing:border-box; font-family:"PingFang SC","Microsoft YaHei",sans-serif; }
body { background:var(--bg); color:var(--text); font-size:14px; }

/* ---------------- 表单控件兜底（裸 input 统一圆角） ----------------
 * 全站存在若干「裸 input」——无类名的孤立输入框（单据汇总区整单折扣、财务实收资本、
 * 凭证税率、报表印章尺寸等），它们不受任何组件规则约束，会露出浏览器默认的方角黑边框，
 * 与整站圆角风格突兀。这里给出统一的输入框视觉。
 * 特异度仅 (0,1,1)，故 .filter-bar input / .field input / .login-box input /
 * 编辑表格内 input 等更具体的规则都会正常覆盖本兜底，不影响既有页面。
 * 注意：刻意不含 select / textarea，避免与个别页面内联的元素级规则（如 index.html 的 textarea）
 * 同特异度相互覆盖。 */
input[type=text], input[type=number], input[type=date], input[type=tel],
input[type=search], input[type=email], input[type=password], input[type=url],
input[type=month], input[type=time], input[type=datetime-local], input:not([type]) {
  border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--bg);
  padding:7px 11px; font-size:13px; line-height:1.4; color:var(--text);
  outline:none; box-sizing:border-box;
  transition:border-color .2s, box-shadow .2s, background .2s;
}
input[type=text]:focus, input[type=number]:focus, input[type=date]:focus, input[type=tel]:focus,
input[type=search]:focus, input[type=email]:focus, input[type=password]:focus, input[type=url]:focus,
input[type=month]:focus, input[type=time]:focus, input[type=datetime-local]:focus, input:not([type]):focus {
  border-color:var(--brand); box-shadow:0 0 0 3px rgba(15,52,96,.12); background:#fff;
}

/* ---------------- 布局 ---------------- */
.layout { display:flex; min-height:100vh; }
.sidebar { width:200px; background:linear-gradient(180deg,var(--brand) 0%,var(--brand) 60%,var(--brand-2) 100%); color:#fff; flex-shrink:0; box-shadow:2px 0 16px rgba(15,52,96,.18); }
.logo { padding:16px 14px; border-bottom:1px solid rgba(255,255,255,.12); display:flex; align-items:center; gap:10px; }
.logo-icon { width:38px; height:38px; border-radius:10px; background:var(--brand-grad); display:flex; align-items:center; justify-content:center; font-size:20px; box-shadow:0 0 0 2px var(--gold), 0 4px 10px rgba(15,52,96,.3); }
.logo-text { display:flex; flex-direction:column; line-height:1.25; }
.logo-text div:first-child { font-size:16px; font-weight:700; }
.logo-sub { font-size:11px; color:rgba(255,255,255,.55); font-weight:500; }
.nav-group { margin-top:8px; }
.nav-title { padding:8px 16px 4px; font-size:11px; color:rgba(255,255,255,.45); text-transform:uppercase; letter-spacing:.5px; }
.nav-item { padding:9px 8px 9px 12px; cursor:pointer; transition:background .15s; font-size:13px; color:rgba(255,255,255,.92); display:flex; align-items:center; text-decoration:none; border-radius:0 22px 22px 0; margin-right:10px; }
.nav-item:hover { background:rgba(255,255,255,.1); color:#fff; }
.nav-item.active { background:rgba(255,255,255,.18); font-weight:600; color:#fff; box-shadow:inset 3px 0 0 #D4AF67; }
.nav-icon { width:26px; display:flex; justify-content:center; align-items:center; margin-right:8px; font-size:15px; }
.nav-text { flex:1; }
.nav-item .plus { display:flex; width:20px; height:20px; align-items:center; justify-content:center; border-radius:5px; font-size:14px; color:rgba(255,255,255,.7); background:rgba(255,255,255,.12); transition:all .15s; opacity:0; }
.nav-item:hover .plus { opacity:1; }
.nav-item .plus:hover { background:rgba(255,255,255,.3); color:#fff; transform:scale(1.1); }
.main { flex:1; display:flex; flex-direction:column; min-width:0; }
.topbar { background:#fff; padding:12px 20px; display:flex; justify-content:space-between; align-items:center; border-bottom:1px solid var(--border); box-shadow:0 2px 10px rgba(15,52,96,.04); }
.topbar h2 { font-size:17px; }
.topbar .sub { color:var(--muted); font-size:12px; margin-top:2px; }
.topbar-actions { display:flex; gap:10px; align-items:center; }
.whoami { font-size:13px; color:#595959; margin-right:6px; }
.content { padding:16px 20px; overflow:auto; }
.page-tabs { background:#fff; padding:0 20px; border-bottom:1px solid var(--border); display:flex; gap:4px; }
.page-tabs a { padding:10px 14px; font-size:13px; color:#595959; text-decoration:none; border-bottom:2px solid transparent; transition:all .15s; }
.page-tabs a:hover { color:var(--brand); }
.page-tabs a.active { color:var(--brand); border-bottom-color:var(--brand); font-weight:600; }
.page-tabs .sep { color:#d9d9d9; padding:10px 0; }

/* ---------------- 统计卡片 ---------------- */
.stats { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin-bottom:14px; }
.card { background:#fff; border-radius:14px; padding:16px 18px; box-shadow:0 2px 10px rgba(15,52,96,.06); border:1px solid rgba(15,52,96,.05); transition:transform .2s,box-shadow .2s; position:relative; overflow:hidden; }
.card:hover { transform:translateY(-2px); box-shadow:0 8px 22px rgba(15,52,96,.12); }
.card::before{ content:''; position:absolute; left:0; top:0; bottom:0; width:4px; background:linear-gradient(180deg,var(--brand),var(--brand-2)); border-radius:0 4px 4px 0; }
.card .label { color:var(--muted); font-size:12px; font-weight:600; }
.card .value { font-size:24px; font-weight:800; margin-top:6px; color:var(--text); }
.card .trend { font-size:12px; margin-top:4px; }
.up { color:var(--gold-deep); } .profit { color:#B8860B; } .muted { color:var(--muted); }

/* ---------------- 筛选条 ---------------- */
.filter-bar { background:#fff; border-radius:14px; padding:14px 16px; margin-bottom:14px; display:flex; flex-wrap:wrap; gap:10px; align-items:center; box-shadow:0 2px 10px rgba(15,52,96,.06); border:1px solid rgba(15,52,96,.05); }
.filter-bar label { font-size:13px; color:#595959; font-weight:600; }
.filter-bar input, .filter-bar select { padding:8px 12px; min-height:38px; box-sizing:border-box; border:1px solid var(--border); border-radius:10px; font-size:13px; outline:none; background:var(--bg); transition:border-color .2s,box-shadow .2s; }
.filter-bar input:focus, .filter-bar select:focus { border-color:var(--brand); box-shadow:0 0 0 3px rgba(15,52,96,.12); background:#fff; }

/* ---------------- 按钮 ---------------- */
.btn { padding:8px 16px; border:1px solid var(--border); background:#fff; border-radius:10px; cursor:pointer; font-size:13px; transition:all .2s; box-shadow:0 1px 3px rgba(0,0,0,.04); font-weight:600; }
.btn:hover { border-color:var(--brand); color:var(--brand); transform:translateY(-1px); box-shadow:0 4px 12px rgba(15,52,96,.14); }
.btn-primary { background:linear-gradient(135deg,var(--brand),var(--brand)); border-color:transparent; color:#fff; box-shadow:0 4px 14px rgba(15,52,96,.3); }
.btn-primary:hover { background:linear-gradient(135deg,var(--brand),var(--brand)); color:#fff; box-shadow:0 6px 18px rgba(15,52,96,.4); }
.btn-ai { background:var(--brand-grad); border:1px solid var(--gold); color:#fff; font-weight:600; box-shadow:0 4px 14px rgba(15,52,96,.3); }
.btn-ai:hover { opacity:.92; color:var(--gold); box-shadow:0 6px 18px rgba(15,52,96,.4); }
.btn-danger { color:#D14343; border-color:#f3c4c4; }
.btn-sm { padding:4px 10px; font-size:12px; border-radius:8px; }

/* ---------------- 表格 ---------------- */
.table-wrap { background:#fff; border-radius:14px; box-shadow:0 2px 10px rgba(15,52,96,.06); overflow:auto; border:1px solid rgba(15,52,96,.05); }
table { width:100%; border-collapse:collapse; }
thead th { background:linear-gradient(180deg,var(--bg),var(--bg)); padding:12px 12px; text-align:left; font-size:13px; color:var(--muted); border-bottom:1px solid var(--border); white-space:nowrap; font-weight:700; }
tbody td { padding:12px 12px; border-bottom:1px solid var(--border); font-size:13px; white-space:nowrap; }
tbody tr { transition:background .15s; }
tbody tr:hover { background:var(--bg); }
.money { color:var(--gold-deep); font-weight:600; }

/* ---------------- 标签 ---------------- */
.tag { display:inline-block; padding:2px 8px; border-radius:999px; font-size:12px; }
.tag-green { background:#f6ffed; color:#389e0d; border:1px solid #b7eb8f; }
.tag-red { background:#fdeaea; color:#D14343; border:1px solid #f3c4c4; }
.tag-orange { background:#fff7e6; color:#d46b08; border:1px solid #ffd591; }
.tag-purple { background:#EEF2F8; color:var(--brand); border:1px solid #cdd9ea; }
.link { color:var(--brand); cursor:pointer; margin-right:8px; }
.link:hover { text-decoration:underline; }
.age-warn { color:#d46b08; font-weight:600; }
.age-danger { color:#D14343; font-weight:700; }

/* ---------------- 批量操作条 ---------------- */
.batch-bar { display:none; background:var(--brand-soft); border:1px solid var(--brand-line); border-radius:12px; padding:10px 16px; margin-bottom:12px; align-items:center; gap:10px; }
.batch-bar.show { display:flex; }

/* ---------------- 弹窗 ---------------- */
.modal-mask { display:none; position:fixed; inset:0; background:rgba(15,52,96,.5); z-index:100; align-items:center; justify-content:center; backdrop-filter:blur(3px); }
.modal-mask.show { display:flex; }
.modal { background:#fff; border-radius:18px; width:660px; max-width:94vw; max-height:88vh; overflow:auto; box-shadow:0 20px 60px rgba(20,10,45,.3); animation:modalIn .25s ease; }
@keyframes modalIn{ from{ opacity:0; transform:scale(.96) translateY(10px); } to{ opacity:1; transform:none; } }
.modal-head { padding:16px 20px; border-bottom:1px solid var(--border); display:flex; justify-content:space-between; align-items:center; }
.modal-head h3 { font-size:16px; }
.close { cursor:pointer; font-size:18px; color:#999; }
.modal-body { padding:18px 20px; }
.modal-foot { padding:14px 20px; border-top:1px solid var(--border); display:flex; justify-content:flex-end; gap:10px; }
textarea { width:100%; height:110px; padding:10px; border:1px solid var(--border); border-radius:12px; font-size:13px; resize:vertical; font-family:inherit; background:var(--bg); transition:border-color .2s,box-shadow .2s; }
textarea:focus { outline:none; border-color:var(--brand); box-shadow:0 0 0 3px rgba(15,52,96,.12); background:#fff; }
.hint { font-size:12px; color:var(--muted); margin-top:6px; line-height:1.7; }

/* ---------------- toast ---------------- */
.toast { position:fixed; top:70px; left:50%; transform:translateX(-50%); background:#333; color:#fff; padding:11px 22px; border-radius:999px; font-size:13px; z-index:300; display:none; box-shadow:0 8px 24px rgba(0,0,0,.22); }
.toast.show { display:block; animation:toastIn .25s ease; }
@keyframes toastIn{ from{ opacity:0; transform:translate(-50%,-8px); } to{ opacity:1; transform:translate(-50%,0); } }

/* ---------------- 分页 ---------------- */
.pager { padding:12px 16px; display:flex; justify-content:space-between; color:var(--muted); font-size:13px; }

/* ---------------- 登录层 ---------------- */
#loginMask { position:fixed; inset:0; background:linear-gradient(135deg,var(--brand),var(--brand-2)); z-index:500; display:flex; align-items:center; justify-content:center; }
.login-box { background:#fff; border-radius:22px; padding:38px 38px; width:380px; box-shadow:0 24px 70px rgba(10,5,30,.45); animation:modalIn .35s ease; }
.login-box h2 { font-size:22px; margin-bottom:4px; }
.login-box .sub { color:var(--muted); font-size:12px; margin-bottom:22px; }
.login-box input { width:100%; padding:12px 14px; border:1px solid var(--border); border-radius:12px; font-size:14px; margin-bottom:14px; outline:none; background:var(--bg); transition:border-color .2s,box-shadow .2s; }
.login-box input:focus { border-color:var(--brand); box-shadow:0 0 0 3px rgba(15,52,96,.12); background:#fff; }
.login-box .btn { width:100%; padding:12px; font-size:15px; border-radius:12px; }
.login-err { color:#D14343; font-size:12px; margin-bottom:10px; display:none; }
@media (max-width:768px){
  #loginMask{ align-items:flex-start; padding-top:14vh; overflow-y:auto; }
  .login-box{ width:86%; max-width:380px; padding:26px 22px; }
}

/* ---------------- 加载态 ---------------- */
.loading { text-align:center; color:#bbb; padding:36px; }
