/* ─── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue: #1a3a5c;
  --blue-light: #2a5080;
  --blue-dark: #0f2847;
  --gold: #c9a84c;
  --gold-light: #e8c96a;
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #1a1a2e;
  --text-muted: #6b7a8d;
  --border: #dde2ea;
  --green: #2d8a5e;
  --green-light: #e8f5ee;
  --orange: #d4820a;
  --orange-light: #fef3e2;
  --red: #c0392b;
  --gray: #8a9ab5;
}

body {
  font-family: 'Inter', 'Noto Serif SC', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.site-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Header ───────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--blue);
  color: #fff;
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 40px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header-logo { display: flex; align-items: center; gap: 14px; }
.logo-mark {
  width: 42px;
  height: 42px;
  background: var(--gold);
  color: var(--blue-dark);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Noto Serif SC', serif;
  font-size: 22px;
  font-weight: 700;
}
.logo-name {
  font-family: 'Noto Serif SC', serif;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 1px;
}
.logo-en { font-size: 11px; opacity: 0.65; letter-spacing: 0.5px; }
.header-date { font-size: 13px; opacity: 0.7; }

/* ─── Hero ─────────────────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(160deg, var(--blue-dark) 0%, var(--blue) 60%, var(--blue-light) 100%);
  color: #fff;
  padding: 64px 40px;
  text-align: center;
}
.hero-inner { max-width: 600px; margin: 0 auto; }
.hero-badge {
  display: inline-block;
  padding: 4px 16px;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 20px;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 20px;
}
.hero-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 36px;
  font-weight: 300;
  letter-spacing: 4px;
  margin-bottom: 16px;
}
.hero-desc { font-size: 15px; opacity: 0.75; line-height: 1.8; }

/* ─── Entries ──────────────────────────────────────────────────────────────── */
.entries {
  flex: 1;
  padding: 48px 40px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}
.entries-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.entry-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 36px 32px;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.entry-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}
.entry-card--customs::before { background: var(--blue); }
.entry-card--finance::before { background: var(--gold); }

.entry-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.12);
}
.entry-card--customs:hover { border-color: var(--blue); }
.entry-card--finance:hover { border-color: var(--gold); }

.entry-icon { margin-bottom: 8px; }
.entry-card--customs .entry-icon { color: var(--blue); }
.entry-card--finance .entry-icon { color: var(--gold); }

.entry-label {
  font-family: 'Noto Serif SC', serif;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 2px;
}
.entry-sub { font-size: 12px; color: var(--text-muted); letter-spacing: 1px; text-transform: uppercase; }
.entry-desc { font-size: 14px; color: var(--text-muted); margin-top: 6px; line-height: 1.7; }
.entry-arrow {
  position: absolute;
  bottom: 24px;
  right: 24px;
  opacity: 0.3;
  transition: opacity 0.2s, transform 0.2s;
}
.entry-card:hover .entry-arrow { opacity: 0.7; transform: translateX(4px); }
.entry-card--customs .entry-arrow { color: var(--blue); }
.entry-card--finance .entry-arrow { color: var(--gold); }

.entry-count {
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}
.entry-card--customs .count-num { color: var(--blue); font-weight: 600; font-size: 22px; }
.entry-card--finance .count-num { color: var(--gold); font-weight: 600; font-size: 22px; }

/* ─── Page Header (for list pages) ─────────────────────────────────────────── */
.page-header {
  background: var(--blue);
  color: #fff;
  padding: 40px;
}
.page-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.page-header-left { display: flex; align-items: center; gap: 14px; }
.back-link {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.15s;
}
.back-link:hover { color: #fff; }
.page-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 2px;
}
.page-subtitle { font-size: 12px; opacity: 0.6; letter-spacing: 1px; }

/* ─── List Page Body ──────────────────────────────────────────────────────── */
.list-body {
  flex: 1;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  padding: 32px 40px;
}

/* ─── Summary Bar ─────────────────────────────────────────────────────────── */
.summary-bar {
  display: flex;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.summary-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 160px;
}
.summary-icon { font-size: 28px; line-height: 1; }
.summary-num {
  font-size: 28px;
  font-weight: 600;
  line-height: 1;
  color: var(--blue);
}
.summary-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ─── Contract List ────────────────────────────────────────────────────────── */
.contract-list { display: flex; flex-direction: column; gap: 12px; }

.contract-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.contract-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.08); }

.contract-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
  gap: 16px;
}
.contract-header:hover { background: #fafbfc; }
.contract-id {
  font-family: 'Noto Serif SC', serif;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 1px;
}
.contract-date { font-size: 12px; color: var(--text-muted); }
.contract-expand {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}
.contract-expand svg { transition: transform 0.2s; }
.contract-card.open .contract-expand svg { transform: rotate(180deg); }

.contract-detail { display: none; padding: 0 20px 20px; border-top: 1px solid var(--border); }
.contract-card.open .contract-detail { display: block; }

/* ─── Workflow Steps ───────────────────────────────────────────────────────── */
.workflow {
  display: flex;
  gap: 0;
  margin: 16px 0;
  position: relative;
}
.workflow::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 1;
}
.step-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray);
  transition: all 0.2s;
}
.step.done .step-circle {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.step.pending .step-circle {
  background: #fff;
  border-color: var(--gold);
  color: var(--gold);
}
.step-label { font-size: 12px; color: var(--text-muted); text-align: center; }
.step.done .step-label { color: var(--green); font-weight: 500; }
.step-person { font-size: 11px; color: var(--text-muted); text-align: center; }
.step.done .step-person { color: var(--text); }

/* ─── File List ────────────────────────────────────────────────────────────── */
.files-section { margin-top: 12px; }
.files-section-title { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; letter-spacing: 1px; text-transform: uppercase; }
.files-row { display: flex; flex-wrap: wrap; gap: 8px; }
.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.15s;
}
.file-chip:hover { background: var(--blue); color: #fff; border-color: var(--blue); }
.file-chip svg { flex-shrink: 0; }
.no-files { font-size: 12px; color: var(--gray); }

/* ─── Download All ─────────────────────────────────────────────────────────── */
.download-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
  margin-top: 12px;
}
.download-all:hover { background: var(--blue-dark); }

/* ─── Status Badge ────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}
.badge-done { background: var(--green-light); color: var(--green); }
.badge-pending { background: var(--orange-light); color: var(--orange); }
.badge-empty { background: var(--bg); color: var(--gray); }

/* ─── Footer ───────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--blue-dark);
  color: rgba(255,255,255,0.5);
  font-size: 12px;
  margin-top: auto;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ─── Empty ────────────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 0;
  color: var(--text-muted);
  font-size: 14px;
}
.empty-state-sm { padding: 20px 0; font-size: 13px; color: var(--gray); text-align: center; }

/* ─── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .header-inner, .page-header-inner { padding: 0 20px; }
  .hero { padding: 40px 20px; }
  .hero-title { font-size: 26px; }
  .entries { padding: 24px 20px; }
  .entries-grid { grid-template-columns: 1fr; }
  .list-body { padding: 20px; }
  .workflow::before { left: 10px; right: 10px; }
  .site-footer .footer-inner { flex-direction: column; gap: 8px; padding: 16px 20px; }
}
