/* ============================================================
   发票通 InvoiceHub — 全局样式
   金融科技风格: 深蓝 #071B3A / 金色 #D5A84D / 青色 #2BC4B6
   ============================================================ */

:root {
  --c-primary:    #071B3A;
  --c-primary-2:  #0d2a5c;
  --c-primary-3:  #143a78;
  --c-gold:       #D5A84D;
  --c-gold-soft:  #f0d99a;
  --c-teal:       #2BC4B6;
  --c-teal-dark:  #1fa599;
  --c-danger:     #e74c3c;
  --c-success:    #27ae60;
  --c-warning:    #f39c12;
  --c-bg:         #f5f7fb;
  --c-card:       #ffffff;
  --c-border:     #e3e8f0;
  --c-text:       #1f2a3d;
  --c-text-2:     #5a6a85;
  --c-text-3:     #8a99b3;
  --radius:       10px;
  --radius-lg:    16px;
  --shadow-sm:    0 2px 8px rgba(7,27,58,.06);
  --shadow:       0 6px 24px rgba(7,27,58,.10);
  --shadow-lg:    0 16px 48px rgba(7,27,58,.18);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue",
               Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: var(--c-text);
  background: var(--c-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--c-primary-3); text-decoration: none; }
a:hover { color: var(--c-teal); }
img { max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border-radius: 8px; font-weight: 500;
  transition: all .2s; white-space: nowrap;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--c-primary); color: #fff;
}
.btn-primary:hover { background: var(--c-primary-2); color: #fff; }
.btn-gold {
  background: var(--c-gold); color: #1a1a1a;
}
.btn-gold:hover { background: #c69a3d; }
.btn-teal {
  background: var(--c-teal); color: #fff;
}
.btn-teal:hover { background: var(--c-teal-dark); }
.btn-ghost {
  background: transparent; color: var(--c-primary); border-color: var(--c-border);
}
.btn-ghost:hover { border-color: var(--c-primary); color: var(--c-primary); }
.btn-danger {
  background: #fff; color: var(--c-danger); border-color: var(--c-danger);
}
.btn-danger:hover { background: var(--c-danger); color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 表单 ---------- */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; margin-bottom: 6px; color: var(--c-text-2);
  font-size: 13px; font-weight: 500;
}
.form-control {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--c-border); border-radius: 8px;
  background: #fff; color: var(--c-text);
  transition: border-color .2s, box-shadow .2s;
}
.form-control:focus {
  outline: none; border-color: var(--c-teal);
  box-shadow: 0 0 0 3px rgba(43,196,182,.15);
}
textarea.form-control { resize: vertical; min-height: 80px; }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }
.form-hint { font-size: 12px; color: var(--c-text-3); margin-top: 4px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--c-card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); padding: 24px;
  border: 1px solid var(--c-border);
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.card-title {
  font-size: 16px; font-weight: 600; color: var(--c-primary);
}

/* ---------- 标签/徽章 ---------- */
.badge {
  display: inline-block; padding: 2px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 500;
}
.badge-pending   { background: #fff4e0; color: #b7791f; }
.badge-issued    { background: #e3f7ec; color: #1e7e43; }
.badge-rejected  { background: #fde8e6; color: #b83226; }
.badge-approved  { background: #e3f7ec; color: #1e7e43; }
.badge-paid      { background: #e0f0ff; color: #1a4f9e; }
.badge-special   { background: #e8eefb; color: var(--c-primary-3); }
.badge-normal    { background: #f0f2f7; color: var(--c-text-2); }
.badge-admin     { background: var(--c-primary); color: #fff; }
.badge-finance   { background: var(--c-gold); color: #1a1a1a; }
.badge-sales     { background: var(--c-teal); color: #fff; }

/* ============================================================
   落地页 (Landing)
   ============================================================ */
.landing-nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.95); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--c-border);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 20px; font-weight: 700; color: var(--c-primary);
}
.logo-icon {
  width: 36px; height: 36px; border-radius: 9px;
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-3) 100%);
  display: flex; align-items: center; justify-content: center;
  color: var(--c-gold); font-weight: 700; font-size: 18px;
}
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a {
  color: var(--c-text-2); font-weight: 500; font-size: 14px;
  transition: color .2s;
}
.nav-links a:hover { color: var(--c-primary); }

.hero {
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-2) 60%, var(--c-primary-3) 100%);
  color: #fff; padding: 80px 24px 100px;
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; right: -100px; top: -100px;
  width: 400px; height: 400px; border-radius: 50%;
  background: radial-gradient(circle, rgba(213,168,77,.2) 0%, transparent 70%);
}
.hero::after {
  content: ''; position: absolute; left: -80px; bottom: -120px;
  width: 350px; height: 350px; border-radius: 50%;
  background: radial-gradient(circle, rgba(43,196,182,.15) 0%, transparent 70%);
}
.hero-inner {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 60px;
  align-items: center; position: relative; z-index: 1;
}
.hero h1 {
  font-size: 44px; line-height: 1.25; margin-bottom: 20px;
  letter-spacing: -.5px;
}
.hero h1 .gold { color: var(--c-gold); }
.hero p.subtitle {
  font-size: 17px; color: rgba(255,255,255,.78);
  margin-bottom: 32px; line-height: 1.7;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-actions .btn { padding: 13px 28px; font-size: 15px; }

.hero-visual {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px; padding: 24px;
  backdrop-filter: blur(10px);
}
.hero-visual .stat-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin-bottom: 14px;
}
.hero-stat {
  background: rgba(255,255,255,.08); border-radius: 10px; padding: 16px;
}
.hero-stat .num {
  font-size: 26px; font-weight: 700; color: var(--c-gold);
}
.hero-stat .label {
  font-size: 12px; color: rgba(255,255,255,.7);
}
.hero-bar {
  background: rgba(255,255,255,.08); border-radius: 8px; padding: 14px;
}
.bar-row {
  display: flex; align-items: flex-end; gap: 10px; height: 80px;
  margin-top: 10px;
}
.bar {
  flex: 1; background: linear-gradient(180deg, var(--c-teal), var(--c-teal-dark));
  border-radius: 4px 4px 0 0;
}

/* Section 通用 */
.section { padding: 80px 24px; }
.section-alt { background: #fff; }
.section-inner { max-width: 1200px; margin: 0 auto; }
.section-title {
  text-align: center; font-size: 32px; font-weight: 700;
  color: var(--c-primary); margin-bottom: 12px;
}
.section-subtitle {
  text-align: center; color: var(--c-text-2); font-size: 16px;
  margin-bottom: 50px;
}

/* Features */
.features-grid {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 24px;
}
.feature-card {
  background: #fff; border-radius: var(--radius-lg);
  padding: 32px 28px; border: 1px solid var(--c-border);
  transition: transform .25s, box-shadow .25s;
}
.feature-card:hover {
  transform: translateY(-4px); box-shadow: var(--shadow);
}
.feature-icon {
  width: 52px; height: 52px; border-radius: 12px;
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-3));
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; margin-bottom: 18px;
}
.feature-card h3 {
  font-size: 18px; color: var(--c-primary); margin-bottom: 10px;
}
.feature-card p { color: var(--c-text-2); font-size: 14px; }

/* Pricing */
.pricing-grid {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 24px;
}
.pricing-card {
  background: #fff; border-radius: var(--radius-lg);
  padding: 36px 30px; border: 1px solid var(--c-border);
  position: relative; transition: transform .25s, box-shadow .25s;
}
.pricing-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.pricing-card.featured {
  border-color: var(--c-gold);
  box-shadow: 0 12px 40px rgba(213,168,77,.2);
  transform: scale(1.03);
}
.pricing-card.featured:hover { transform: scale(1.03) translateY(-4px); }
.pricing-tag {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--c-gold); color: #1a1a1a;
  padding: 4px 16px; border-radius: 20px; font-size: 12px; font-weight: 600;
}
.pricing-name { font-size: 20px; font-weight: 600; color: var(--c-primary); margin-bottom: 8px; }
.pricing-price {
  font-size: 38px; font-weight: 700; color: var(--c-primary);
  margin: 18px 0;
}
.pricing-price .unit { font-size: 14px; color: var(--c-text-3); font-weight: 400; }
.pricing-features { list-style: none; margin: 24px 0; }
.pricing-features li {
  padding: 8px 0; color: var(--c-text-2); font-size: 14px;
  border-bottom: 1px dashed var(--c-border);
}
.pricing-features li:last-child { border: none; }
.pricing-features li::before {
  content: '✓'; color: var(--c-teal); font-weight: 700; margin-right: 8px;
}

/* Footer */
.landing-footer {
  background: var(--c-primary); color: rgba(255,255,255,.7);
  padding: 40px 24px; text-align: center; font-size: 13px;
}
.landing-footer a { color: var(--c-gold); }
.landing-footer .footer-row { margin-bottom: 6px; }

/* ============================================================
   登录/注册
   ============================================================ */
.auth-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-3) 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 40px 20px;
}
.auth-card {
  background: #fff; border-radius: var(--radius-lg);
  width: 100%; max-width: 460px; padding: 40px 36px;
  box-shadow: var(--shadow-lg);
}
.auth-card .logo { justify-content: center; margin-bottom: 24px; }
.auth-card h2 {
  text-align: center; color: var(--c-primary); margin-bottom: 6px; font-size: 24px;
}
.auth-card .sub { text-align: center; color: var(--c-text-3); margin-bottom: 28px; }
.auth-toggle {
  text-align: center; margin-top: 18px; color: var(--c-text-2); font-size: 13px;
}
.auth-toggle a { color: var(--c-primary-3); font-weight: 500; }
.auth-back {
  text-align: center; margin-top: 14px;
}
.auth-back a { color: var(--c-text-3); font-size: 12px; }

/* ============================================================
   后台 App 布局
   ============================================================ */
.app-layout {
  display: grid; grid-template-columns: 220px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: var(--c-primary); color: #fff;
  padding: 24px 0; position: sticky; top: 0; height: 100vh;
  overflow-y: auto;
}
.sidebar .logo {
  padding: 0 22px 24px; color: #fff; font-size: 18px;
  border-bottom: 1px solid rgba(255,255,255,.1); margin-bottom: 16px;
}
.sidebar .logo .logo-icon { width: 32px; height: 32px; font-size: 16px; }
.side-nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 22px; color: rgba(255,255,255,.7);
  cursor: pointer; transition: all .2s; font-size: 14px;
  border-left: 3px solid transparent;
}
.side-nav-item:hover {
  background: rgba(255,255,255,.05); color: #fff;
}
.side-nav-item.active {
  background: rgba(43,196,182,.12); color: var(--c-teal);
  border-left-color: var(--c-teal);
}
.side-nav-item .icon { font-size: 18px; width: 22px; text-align: center; }
.side-section-title {
  padding: 16px 22px 6px; font-size: 11px; color: rgba(255,255,255,.4);
  text-transform: uppercase; letter-spacing: 1px;
}

.main { padding: 24px 32px; max-width: 100%; overflow-x: hidden; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.topbar h1 {
  font-size: 22px; color: var(--c-primary);
}
.user-chip {
  display: flex; align-items: center; gap: 12px;
  background: #fff; padding: 6px 14px 6px 6px; border-radius: 30px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--c-border);
}
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--c-gold), #c69a3d);
  color: #1a1a1a; display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 14px;
}
.user-chip .info { line-height: 1.2; }
.user-chip .name { font-weight: 500; font-size: 13px; }
.user-chip .role { font-size: 11px; color: var(--c-text-3); }

/* ---------- 数据看板卡片 ---------- */
.stat-grid {
  display: grid; grid-template-columns: repeat(4,1fr); gap: 18px;
  margin-bottom: 24px;
}
.stat-card {
  background: #fff; border-radius: var(--radius-lg); padding: 22px;
  border: 1px solid var(--c-border); box-shadow: var(--shadow-sm);
}
.stat-card .label {
  color: var(--c-text-3); font-size: 13px; margin-bottom: 10px;
}
.stat-card .value {
  font-size: 28px; font-weight: 700; color: var(--c-primary);
}
.stat-card .value.gold { color: var(--c-gold); }
.stat-card .value.teal { color: var(--c-teal-dark); }
.stat-card .value.red { color: var(--c-danger); }
.stat-card .sub { font-size: 12px; color: var(--c-text-3); margin-top: 6px; }

.charts-row {
  display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; margin-bottom: 18px;
}
.chart-bars {
  display: flex; align-items: flex-end; gap: 14px;
  height: 200px; padding-top: 20px;
  border-bottom: 1px solid var(--c-border);
}
.chart-bar-col {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 8px; height: 100%; justify-content: flex-end;
}
.chart-bar {
  width: 100%; max-width: 40px;
  background: linear-gradient(180deg, var(--c-teal), var(--c-primary-3));
  border-radius: 6px 6px 0 0;
  position: relative; transition: all .3s;
  min-height: 4px;
}
.chart-bar:hover { opacity: .85; }
.chart-bar .bar-val {
  position: absolute; top: -22px; left: 50%; transform: translateX(-50%);
  font-size: 11px; color: var(--c-text-2); white-space: nowrap;
}
.chart-bar-label { font-size: 11px; color: var(--c-text-3); }

/* 类型分布 - 简单的水平条 */
.type-row {
  display: flex; align-items: center; gap: 12px; margin-bottom: 14px;
}
.type-row .type-label { width: 80px; font-size: 13px; color: var(--c-text-2); }
.type-row .type-bar-bg {
  flex: 1; height: 22px; background: #f0f2f7; border-radius: 4px; overflow: hidden;
}
.type-row .type-bar { height: 100%; border-radius: 4px; }
.type-row .type-val { width: 50px; text-align: right; font-size: 13px; font-weight: 500; }

/* 部门统计表格 */
table.data-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
table.data-table th, table.data-table td {
  padding: 12px 14px; text-align: left;
  border-bottom: 1px solid var(--c-border);
}
table.data-table th {
  color: var(--c-text-3); font-weight: 500; font-size: 12px;
  text-transform: uppercase; letter-spacing: .5px;
  background: #fafbfd;
}
table.data-table tr:hover td { background: #fafbfd; }
table.data-table td .amount { font-weight: 600; color: var(--c-primary); }

/* ---------- Tab 切换 ---------- */
.tabs {
  display: flex; gap: 4px; margin-bottom: 20px;
  border-bottom: 1px solid var(--c-border);
}
.tab {
  padding: 10px 18px; cursor: pointer; color: var(--c-text-2);
  border-bottom: 2px solid transparent; font-size: 14px; font-weight: 500;
  transition: all .2s;
}
.tab:hover { color: var(--c-primary); }
.tab.active {
  color: var(--c-primary); border-bottom-color: var(--c-teal);
}

/* ---------- 列表项 ---------- */
.invoice-item {
  background: #fff; border: 1px solid var(--c-border);
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 12px;
  transition: box-shadow .2s;
}
.invoice-item:hover { box-shadow: var(--shadow-sm); }
.invoice-item.duplicate { border-color: var(--c-danger); background: #fff5f5; }
.invoice-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 10px; flex-wrap: wrap; gap: 8px;
}
.invoice-title { font-weight: 600; color: var(--c-primary); font-size: 15px; }
.invoice-meta {
  display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr));
  gap: 8px 20px; font-size: 13px; color: var(--c-text-2);
}
.invoice-meta .k { color: var(--c-text-3); margin-right: 6px; }
.invoice-meta .amount { color: var(--c-gold); font-weight: 600; font-size: 15px; }
.invoice-actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.invoice-reject-reason {
  margin-top: 10px; padding: 8px 12px; background: #fde8e6;
  border-radius: 6px; color: #b83226; font-size: 12px;
}

/* ---------- Toast ---------- */
.toast-container {
  position: fixed; top: 24px; right: 24px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  padding: 12px 20px; border-radius: 8px; color: #fff;
  box-shadow: var(--shadow); font-size: 14px;
  animation: slideIn .3s ease;
  max-width: 380px;
}
.toast-success { background: var(--c-success); }
.toast-error   { background: var(--c-danger); }
.toast-info    { background: var(--c-primary-3); }
@keyframes slideIn {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* ---------- Modal ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(7,27,58,.55);
  z-index: 1000; display: flex; align-items: center; justify-content: center;
  padding: 20px; animation: fadeIn .2s;
}
@keyframes fadeIn { from {opacity:0} to {opacity:1} }
.modal {
  background: #fff; border-radius: var(--radius-lg);
  width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  padding: 20px 24px; border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { font-size: 18px; color: var(--c-primary); }
.modal-close {
  width: 30px; height: 30px; border-radius: 50%;
  background: #f0f2f7; color: var(--c-text-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.modal-close:hover { background: var(--c-border); }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px; border-top: 1px solid var(--c-border);
  display: flex; justify-content: flex-end; gap: 10px;
}

/* ---------- 空状态 ---------- */
.empty {
  text-align: center; padding: 60px 20px; color: var(--c-text-3);
}
.empty .icon { font-size: 48px; margin-bottom: 12px; opacity: .5; }
.empty p { font-size: 14px; }

/* ---------- 工具类 ---------- */
.text-right { text-align: right; }
.text-center { text-align: center; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.hidden { display: none !important; }
.text-danger { color: var(--c-danger); }
.text-success { color: var(--c-success); }
.text-muted { color: var(--c-text-3); }

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero h1 { font-size: 32px; }
  .features-grid, .pricing-grid { grid-template-columns: 1fr; }
  .pricing-card.featured { transform: none; }
  .pricing-card.featured:hover { transform: translateY(-4px); }
  .stat-grid { grid-template-columns: repeat(2,1fr); }
  .charts-row { grid-template-columns: 1fr; }
  .app-layout { grid-template-columns: 1fr; }
  .sidebar {
    position: static; height: auto; padding: 12px 0;
  }
  .sidebar .logo { padding: 0 16px 12px; margin-bottom: 8px; }
  .side-nav-item { padding: 10px 16px; }
  .side-section-title { padding: 10px 16px 4px; }
  .main { padding: 16px; }
  .nav-links { gap: 14px; }
  .nav-links a { font-size: 13px; }
  .form-row { flex-direction: column; gap: 0; }
  .topbar { flex-direction: column; align-items: flex-start; gap: 12px; }
}
@media (max-width: 560px) {
  .stat-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 26px; }
  .section { padding: 50px 16px; }
  .section-title { font-size: 24px; }
  .auth-card { padding: 28px 22px; }
}
