/* 费用报销电子档案管理系统 — Web 样式（浅色 HyperOS 风：瓷白底 + 天青蓝 + 燃橙） */
:root {
  --bg-base: #F5F6FA;
  --bg-app: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #F8F9FC;
  --surface-3: #EFF2F7;
  --border: #E4E7F0;
  --border-soft: #EEF0F6;
  --grid: #F2F3F8;
  --text: #1A1D2E;
  --text-2: #686C80;
  --text-3: #A0A4B8;
  --cyan: #1677FF;
  --cyan-dim: #0958D9;
  --cyan-soft: #E6F4FF;
  --orange: #FF5722;
  --orange-dim: #E64A19;
  --orange-soft: #FFF2E8;
  --success: #00B578;
  --warning: #FF8F1F;
  --danger: #FF3141;
  --nav-bg: #F0F2F7;
  --nav-bg-top: #FFFFFF;
  --nav-hover: #E4E8F1;
  --nav-active: #E6F4FF;
  --nav-divider: #DDE1EC;
  --shadow: 0 1px 3px rgba(20,30,60,.06), 0 8px 24px rgba(20,30,60,.06);
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", system-ui, sans-serif;
  background: var(--bg-base);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}
a { color: var(--cyan); text-decoration: none; }
a:hover { color: var(--cyan-dim); }

/* ===== 布局 ===== */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; min-width: 240px;
  background: var(--nav-bg);
  border-right: 1px solid var(--nav-divider);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.sidebar-accent {
  height: 4px;
  background: linear-gradient(90deg, var(--cyan) 0%, var(--cyan) 55%, var(--orange) 100%);
}
.sidebar-logo {
  padding: 18px 16px 16px;
  border-bottom: 1px solid var(--nav-divider);
  display: flex; align-items: center; gap: 12px;
}
.logo-icon {
  width: 38px; height: 38px; min-width: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--cyan), var(--orange));
  color: #fff; font-weight: 700; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
}
.logo-title { font-size: 17px; font-weight: 700; letter-spacing: 1px; }
.logo-sub { font-size: 10px; color: var(--text-3); letter-spacing: 2px; margin-top: 2px; }

.nav { flex: 1; padding: 10px 8px; overflow-y: auto; }
.nav-section { font-size: 11px; color: var(--text-3); padding: 12px 12px 6px; letter-spacing: 1px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; margin: 2px 8px;
  border-radius: 10px; color: var(--text-2);
  font-size: 14px; font-weight: 500; cursor: pointer;
  border-left: 3px solid transparent;
}
.nav-item:hover { background: var(--nav-hover); color: var(--text); }
.nav-item.active {
  background: var(--nav-active); color: var(--cyan); font-weight: 600;
  border-left: 3px solid var(--cyan);
}
.nav-icon { width: 18px; text-align: center; }

.sidebar-bottom { border-top: 1px solid var(--nav-divider); padding: 12px; }
.sidebar-user { font-size: 13px; color: var(--text); padding: 4px 8px; }
.sidebar-role { font-size: 11px; color: var(--text-3); padding: 0 8px 6px; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 60px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; background: var(--bg-app); border-bottom: 1px solid var(--border-soft);
  position: sticky; top: 0; z-index: 10;
}
.topbar h1 { font-size: 18px; font-weight: 700; margin: 0; }
.topbar .user-chip { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; }
.content { padding: 24px 28px; }

/* ===== 卡片 ===== */
.card {
  background: var(--bg-app); border: 1px solid var(--border-soft);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px;
}
.card-title { font-size: 15px; font-weight: 700; margin: 0 0 16px; display: flex; align-items: center; gap: 8px; }
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

/* ===== 统计卡 ===== */
.stat {
  background: var(--bg-app); border: 1px solid var(--border-soft);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px;
}
.stat .label { color: var(--text-2); font-size: 13px; }
.stat .value { font-size: 30px; font-weight: 700; margin-top: 6px;
  background: linear-gradient(90deg, var(--cyan), var(--orange)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat .sub { font-size: 12px; color: var(--text-3); margin-top: 4px; }

/* ===== 表单 ===== */
.form-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; color: var(--text-2); font-weight: 500; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=month],
select, textarea {
  background: var(--surface-3); border: 1px solid var(--border);
  border-radius: 10px; padding: 9px 12px; color: var(--text); font-size: 13px;
  min-height: 38px; font-family: inherit; outline: none; transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--cyan); background: var(--bg-app); }
textarea { min-height: 90px; resize: vertical; width: 100%; }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border-soft);
  border-radius: 10px; padding: 9px 18px; font-size: 13px; font-weight: 500; cursor: pointer;
  font-family: inherit; transition: all .15s;
}
.btn:hover { border-color: var(--cyan); color: var(--cyan); }
.btn.primary { background: var(--orange); color: #fff; border: none; font-weight: 600; }
.btn.primary:hover { background: var(--orange-dim); color: #fff; }
.btn.success { background: var(--success); color: #fff; border: none; font-weight: 600; }
.btn.danger { background: var(--danger); color: #fff; border: none; font-weight: 600; }
.btn.info { background: var(--cyan); color: #fff; border: none; font-weight: 600; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 12px; font-size: 12px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ===== 表格 ===== */
.table-wrap { overflow-x: auto; border: 1px solid var(--border-soft); border-radius: var(--radius); background: var(--bg-app); }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  background: var(--surface-3); text-align: left; padding: 11px 12px; font-weight: 600;
  border-bottom: 2px solid var(--cyan); white-space: nowrap; color: var(--text); position: sticky; top: 0;
}
table.data td { padding: 9px 12px; border-bottom: 1px solid var(--grid); color: var(--text); vertical-align: top; }
table.data tbody tr:nth-child(even) { background: var(--surface-2); }
table.data tbody tr:hover { background: var(--cyan-soft); }
.mono { font-family: "JetBrains Mono", "Consolas", monospace; color: var(--cyan); }
.nowrap { white-space: nowrap; }

/* ===== 徽标 ===== */
.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.green { background: #E6F7F0; color: var(--success); }
.badge.orange { background: var(--orange-soft); color: var(--orange); }
.badge.amber { background: #FFF4E0; color: #B45309; }
.badge.cyan { background: var(--cyan-soft); color: var(--cyan); }
.badge.gray { background: var(--surface-3); color: var(--text-2); }
.badge.red { background: #FFECEE; color: var(--danger); }

/* ===== 杂项 ===== */
.muted { color: var(--text-3); }
.text-2 { color: var(--text-2); }
.right { text-align: right; }
.center { text-align: center; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.flex { display: flex; gap: 10px; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.alert { padding: 12px 16px; border-radius: 10px; font-size: 13px; margin-bottom: 16px; }
.alert.info { background: var(--cyan-soft); color: var(--cyan-dim); }
.alert.warn { background: var(--orange-soft); color: var(--orange-dim); }
.alert.danger { background: #FFECEE; color: var(--danger); }
.pill { font-size: 11px; color: var(--text-3); }

/* ===== 登录页 ===== */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 80% -10%, var(--cyan-soft), transparent),
              radial-gradient(1000px 500px at 0% 110%, var(--orange-soft), transparent), var(--bg-base); }
.login-card { width: 380px; background: var(--bg-app); border: 1px solid var(--border-soft);
  border-radius: 18px; box-shadow: var(--shadow); padding: 32px 28px; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.login-error { background: #FFECEE; color: var(--danger); padding: 9px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }
.login-foot { text-align: center; color: var(--text-3); font-size: 12px; margin-top: 18px; }

/* ===== 进度 ===== */
.progress-bar { height: 10px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.progress-bar > span { display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan), var(--orange)); transition: width .3s; }
.log-box { background: #0E1117; color: #C8D3E0; border-radius: 10px; padding: 14px; font-family: "Consolas", monospace; font-size: 12px; height: 280px; overflow-y: auto; white-space: pre-wrap; }
.log-box .ok { color: #23d18b; } .log-box .err { color: #ff6b81; }

/* ===== 预览 ===== */
.preview-iframe { width: 100%; height: 78vh; border: 1px solid var(--border-soft); border-radius: 10px; background: #fff; }
.file-list { list-style: none; margin: 0; padding: 0; }
.file-list li { padding: 10px 12px; border: 1px solid var(--border-soft); border-radius: 10px; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; }

/* ===== 内嵌画廊（仿桌面 LazyPDFGallery） ===== */
.preview-gallery { display: flex; flex-direction: column; gap: 16px; }
.preview-item { border: 1px solid var(--border-soft); border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.preview-item-head { display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 12px; border-bottom: 1px solid var(--border-soft); background: var(--surface-1); }
.preview-img { display: block; width: 100%; height: auto; background: #fff; }
.preview-nonimg { padding: 28px 16px; text-align: center; }
/* ===== 分组（报销单 / 出差申请单 / 发票·附件 / 补充文件） ===== */
.preview-section { margin-bottom: 8px; }
.preview-section-head { display: flex; align-items: center; gap: 10px; margin: 18px 0 10px; }
.section-badge { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 600;
  color: #fff; background: var(--accent); background: linear-gradient(135deg, var(--accent), var(--accent-2)); letter-spacing: .5px; }
.preview-section:first-of-type .preview-section-head { margin-top: 4px; }

/* ===== 模态框 ===== */
.modal-mask { position: fixed; inset: 0; background: rgba(20,30,60,.45); display: none; align-items: center; justify-content: center; z-index: 1000; }
.modal-mask.show { display: flex; }
.modal { width: 680px; max-width: 94vw; max-height: 90vh; background: var(--bg-app); border-radius: 16px;
  box-shadow: 0 12px 48px rgba(20,30,60,.25); display: flex; flex-direction: column; overflow: hidden; }
.modal.wide { width: 1120px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border-soft); }
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close { cursor: pointer; background: none; border: none; font-size: 22px; color: var(--text-3); line-height: 1; padding: 0 4px; }
.modal-close:hover { color: var(--danger); }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border-soft); display: flex; justify-content: flex-end; gap: 10px; align-items: center; }
.info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 20px; background: var(--surface-2);
  border: 1px solid var(--border-soft); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; }
.info-grid .k { color: var(--text-2); font-size: 12px; }
.info-grid .v { color: var(--text); font-size: 13px; font-weight: 600; }
.radio-row { display: flex; gap: 18px; margin-bottom: 12px; }
.radio-row label { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.radio-row input[type=radio] { accent-color: var(--cyan); }
.file-drop { border: 1px dashed var(--border); border-radius: 12px; padding: 18px; text-align: center; color: var(--text-2);
  cursor: pointer; background: var(--surface-2); transition: border-color .15s; }
.file-drop:hover { border-color: var(--cyan); color: var(--cyan); }
.file-list-box { border: 1px solid var(--border-soft); border-radius: 10px; max-height: 170px; overflow-y: auto; margin-top: 10px; }
.file-list-box .item { padding: 7px 12px; border-bottom: 1px solid var(--grid); display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.file-list-box .item:last-child { border-bottom: none; }
.file-list-box .item .rm { color: var(--text-3); cursor: pointer; background: none; border: none; font-size: 15px; }
.file-list-box .item .rm:hover { color: var(--danger); }

/* ===== 多 Tab 预览（金蝶溯源等） ===== */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border-soft); margin-bottom: 14px; flex-wrap: wrap; }
.tab-btn { padding: 8px 16px; border: none; background: none; cursor: pointer; color: var(--text-2); font-size: 13px;
  border-bottom: 2px solid transparent; margin-bottom: -2px; font-family: inherit; }
.tab-btn:hover { color: var(--cyan); }
.tab-btn.active { color: var(--cyan); font-weight: 700; border-bottom-color: var(--cyan); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ===== 金蝶溯源预览文件网格 ===== */
.pv-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.pv-file-card { border: 1px solid var(--border-soft); border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.pv-file-preview { height: 340px; overflow: auto; display: flex; align-items: center; justify-content: center; background: var(--surface-3); }
.pv-file-preview.big { height: 520px; }
.pv-file-preview embed, .pv-file-preview iframe { width: 100%; height: 100%; min-height: 340px; border: none; }
.pv-file-name { padding: 8px 12px; font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1100px) {
  .pv-grid { grid-template-columns: 1fr; }
}
