/* Milestone 1 — Monochrome engineering base stylesheet
   Rules: white background, black text, no color, no external fonts.
   Hand-written CSS only. No framework. */

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

html {
  font-family: system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #000;
  background: #fff;
}

body { min-height: 100vh; }

a { color: #000; }
a:hover { text-decoration: underline; }

/* ── Navigation ───────────────────────────────────────────────────────────── */
.site-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 1.5rem;
  border-bottom: 1.5px solid #000;
  background: #fff;
}

.site-nav__brand {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  letter-spacing: 0.01em;
}

.site-nav__brand:hover { text-decoration: none; opacity: 0.7; }

.site-nav__label {
  font-size: 0.8rem;
  color: #555;
  border-left: 1px solid #ccc;
  padding-left: 1rem;
}

/* ── Page layout ──────────────────────────────────────────────────────────── */
.page { display: flex; flex-direction: column; min-height: 100vh; }

.main {
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* ── Breadcrumb ───────────────────────────────────────────────────────────── */
.breadcrumb {
  font-size: 0.8rem;
  color: #555;
  margin-bottom: 1.2rem;
}

.breadcrumb-sep { margin: 0 0.3rem; color: #999; }

/* ── Page title ───────────────────────────────────────────────────────────── */
.page-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 2rem;
  border-bottom: 1.5px solid #000;
  padding-bottom: 0.5rem;
}

/* ── Page header (title + action button on same line) ─────────────────────── */
.page-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-header .page-title {
  margin-bottom: 0;
  border-bottom: none;
  padding-bottom: 0;
  flex: 1;
}

/* Tag badge next to page title (e.g. "Tunnel") */
.page-title-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid #000;
  padding: 0.1rem 0.4rem;
  vertical-align: middle;
  margin-left: 0.4rem;
}

/* ── Project description line ─────────────────────────────────────────────── */
.project-description {
  font-size: 0.88rem;
  color: #555;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e0e0e0;
}

/* ── Empty state (no items yet) ───────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 2rem 0;
}

/* ── Form hint text (below input) ─────────────────────────────────────────── */
.form-hint {
  display: block;
  font-size: 0.78rem;
  color: #666;
  margin-top: 0.2rem;
}

/* ── Sections ─────────────────────────────────────────────────────────────── */
.section { margin-bottom: 2rem; }

.section-title {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.8rem;
  border-bottom: 1px solid #000;
  padding-bottom: 0.25rem;
}

/* ── Tables ───────────────────────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid #ddd;
}

.data-table th {
  font-weight: 600;
  background: #f5f5f5;
  border-bottom: 1.5px solid #000;
}

/* ── Forms ────────────────────────────────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 0; }

.fieldset {
  border: 1px solid #ccc;
  padding: 1rem;
  margin-bottom: 1.2rem;
}

.fieldset-legend {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0 0.4rem;
}

.form-row { margin-bottom: 0.8rem; }

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.4rem 0.6rem;
  border: 1px solid #999;
  background: #fff;
  color: #000;
  font-size: 0.88rem;
  font-family: inherit;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: 2px solid #000;
  outline-offset: 1px;
}

.form-input--num { max-width: 160px; }

.form-textarea { resize: vertical; }

.required { color: #000; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 0.45rem 1.1rem;
  border: 1.5px solid #000;
  background: #000;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  letter-spacing: 0.02em;
}

.btn:hover { background: #222; text-decoration: none; color: #fff; }

.btn--outline {
  background: #fff;
  color: #000;
}

.btn--outline:hover { background: #f0f0f0; color: #000; }

.btn-small {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border: 1px solid #000;
  font-size: 0.8rem;
  text-decoration: none;
  white-space: nowrap;
}

.btn-small:hover { background: #f0f0f0; text-decoration: none; }

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 0.8rem;
}

.form-actions--between {
  justify-content: space-between;
}

/* ── Messages ─────────────────────────────────────────────────────────────── */
.error-msg {
  background: #f5f5f5;
  border-left: 3px solid #000;
  padding: 0.5rem 0.8rem;
  margin-bottom: 1rem;
  font-size: 0.88rem;
}

.success-msg {
  background: #f5f5f5;
  border-left: 3px solid #000;
  padding: 0.5rem 0.8rem;
  margin-bottom: 1rem;
  font-size: 0.88rem;
}

.empty-msg, .hint-msg {
  color: #555;
  font-size: 0.88rem;
  margin-top: 0.5rem;
}

.muted { color: #666; }

.link { color: #000; text-decoration: underline; }
.link:hover { opacity: 0.6; }

/* ── Report styles ────────────────────────────────────────────────────────── */
.report-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-top: 2px solid #000;
  border-bottom: 2px solid #000;
  padding: 0.8rem 0;
  margin-bottom: 2rem;
}

.report-title-block {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.report-title-en {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.report-title-zh {
  font-size: 1rem;
  font-weight: 600;
  color: #444;
}

.report-meta {
  font-size: 0.78rem;
  color: #666;
  font-family: 'Courier New', Courier, monospace;
}

.report-body { display: flex; flex-direction: column; gap: 0; }

.report-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.5rem 0 0.25rem;
  border-bottom: 1px solid #000;
  margin-top: 1.8rem;
  margin-bottom: 0.6rem;
}

.label-sep { margin: 0 0.3rem; color: #999; }

.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin-bottom: 0.5rem;
}

.report-table tr { border-bottom: 1px solid #e8e8e8; }

.report-label {
  width: 44%;
  padding: 0.4rem 0.6rem 0.4rem 0;
  vertical-align: top;
  font-weight: normal;
}

.report-value {
  padding: 0.4rem 0;
  vertical-align: top;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.86rem;
}

.label-en {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
}

.label-zh {
  display: block;
  font-size: 0.78rem;
  color: #555;
}

.report-freetext {
  padding: 0.5rem 0;
  font-size: 0.88rem;
  white-space: pre-wrap;
  border: 1px solid #e8e8e8;
  padding: 0.6rem;
  background: #fafafa;
  margin-bottom: 0.5rem;
}

.report-placeholder {
  padding: 0.6rem;
  border: 1px dashed #bbb;
  margin-bottom: 0.5rem;
  font-size: 0.84rem;
  color: #888;
}

.placeholder-en { display: block; }
.placeholder-zh { display: block; font-size: 0.8rem; }

.report-footer {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid #ccc;
}
