/* ============================================
   碧桂园江山名筑 · 业委会筹备工作
   Pure CSS · Mobile-first
   ============================================ */

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

/* ====== Variables ====== */
:root {
  --c-primary: #1565c0;
  --c-primary-dk: #0d47a1;
  --c-primary-lt: #42a5f5;
  --c-primary-bg: #e3f2fd;
  --c-success: #2e7d32;
  --c-success-bg: #e8f5e9;
  --c-warn: #ef6c00;
  --c-warn-bg: #fff3e0;
  --c-muted: #78909c;
  --c-muted-bg: #eceff1;
  --c-danger: #c62828;
  --c-text: #263238;
  --c-text-2: #546e7a;
  --c-bg: #f5f7fa;
  --c-white: #fff;
  --c-border: #e0e6ed;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --max-w: 860px;
  --header-h: 56px;
}

/* ====== Base ====== */
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--c-text);
  background: var(--c-bg);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--c-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

/* ====== Typography ====== */
h1, h2, h3, h4 {
  line-height: 1.35;
  color: var(--c-text);
}

h1 { font-size: 1.6rem; }
h2 { font-size: 1.3rem; margin-bottom: 1rem; }
h3 { font-size: 1.1rem; margin-bottom: 0.75rem; }

p {
  margin-bottom: 0.8rem;
}

strong {
  color: var(--c-text);
}

small {
  font-size: 0.82rem;
  color: var(--c-text-2);
}

/* ====== Header ====== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--c-primary-dk);
  box-shadow: var(--shadow);
}

.site-header > nav {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 0.75rem;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  color: var(--c-white) !important;
  font-weight: 800;
  font-size: 0.95rem;
  text-decoration: none !important;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.logo-icon {
  font-size: 1.2rem;
}

.logo-text {
  letter-spacing: 0.5px;
}

/* Mobile toggle */
.nav-toggle {
  color: var(--c-white) !important;
  font-size: 1.5rem;
  text-decoration: none !important;
  padding: 0.25rem;
  flex-shrink: 0;
}

/* Nav links: hidden on mobile */
.nav-links {
  display: none;
  list-style: none;
}

.nav-links.open {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: var(--header-h);
  left: 0;
  right: 0;
  background: var(--c-primary-dk);
  padding: 0.25rem 1rem 0.75rem;
  box-shadow: var(--shadow-lg);
  border-top: 1px solid rgba(255,255,255,0.1);
}

.nav-links a {
  color: rgba(255,255,255,0.8) !important;
  padding: 0.55rem 0;
  font-size: 0.93rem;
  display: block;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  text-decoration: none !important;
}

.nav-links a:last-child {
  border-bottom: none;
}

.nav-links a.active {
  color: var(--c-white) !important;
  font-weight: 700;
}

.nav-links a:hover {
  color: var(--c-white) !important;
}

/* Desktop nav */
@media (min-width: 640px) {
  .site-header > nav {
    padding: 0 1.5rem;
  }

  .site-logo {
    font-size: 1rem;
  }

  .nav-toggle {
    display: none;
  }

  .nav-links {
    display: flex !important;
    flex-direction: row;
    gap: 0;
    position: static;
    background: transparent;
    padding: 0;
    box-shadow: none;
    border-top: none;
  }

  .nav-links a {
    padding: 0.4rem 0.7rem;
    border-radius: 6px;
    border-bottom: none;
    font-size: 0.88rem;
  }

  .nav-links a:hover {
    background: rgba(255,255,255,0.12);
  }

  .nav-links a.active {
    background: rgba(255,255,255,0.18);
  }
}

/* ====== Main Container ====== */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1.25rem 1rem;
  flex: 1;
  width: 100%;
}

@media (min-width: 640px) {
  .container {
    padding: 2rem 1.5rem;
  }
}

/* ====== Hero Card ====== */
.hero-card {
  background: linear-gradient(135deg, var(--c-primary-dk), var(--c-primary));
  color: var(--c-white);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.hero-card h1 {
  color: var(--c-white);
  font-size: 1.5rem;
  margin-bottom: 0.3rem;
}

.hero-card hgroup p {
  color: rgba(255,255,255,0.88);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.hero-legal {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.6);
  margin: 0;
}

@media (min-width: 640px) {
  .hero-card {
    padding: 2.5rem 2rem;
  }
  .hero-card h1 {
    font-size: 2rem;
  }
}

/* ====== Section ====== */
section {
  margin-bottom: 2rem;
}

section > h2 {
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--c-primary-lt);
  display: inline-block;
  margin-bottom: 1.2rem;
}

/* ====== Progress Bar ====== */
.progress-bar-wrapper {
  background: var(--c-muted-bg);
  border-radius: 8px;
  overflow: hidden;
  height: 34px;
}

.progress-bar {
  background: linear-gradient(90deg, var(--c-success), #43a047);
  height: 100%;
  width: var(--progress, 0%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: width 0.8s ease;
}

.progress-bar span {
  color: var(--c-white);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

/* ====== Status Tags ====== */
.status {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.status-done {
  background: var(--c-success-bg);
  color: var(--c-success);
}

.status-wip {
  background: var(--c-warn-bg);
  color: var(--c-warn);
}

.status-todo {
  background: var(--c-muted-bg);
  color: var(--c-muted);
}

/* ====== Details / Accordion ====== */
details {
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  overflow: hidden;
  transition: border-color 0.2s;
}

details[open] {
  border-color: var(--c-primary-lt);
}

summary {
  padding: 0.75rem 1rem;
  font-size: 0.93rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  line-height: 1.5;
  user-select: none;
  list-style: none;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "▸";
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--c-muted);
  transition: transform 0.2s;
}

details[open] summary::after {
  transform: rotate(90deg);
}

.detail-body {
  padding: 1rem;
  border-top: 1px solid var(--c-border);
}

.detail-body p {
  font-size: 0.9rem;
  color: var(--c-text-2);
}

.detail-body nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 0.5rem;
}

.detail-body footer {
  margin-top: 0.6rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--c-border);
}

/* ====== Tables ====== */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: var(--c-white);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--c-border);
}

thead {
  background: var(--c-primary);
  color: var(--c-white);
}

th {
  padding: 0.65rem 0.75rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.85rem;
}

td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--c-border);
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: var(--c-primary-bg);
}

/* Scroll on small screens */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ====== Buttons ====== */
a[role="button"],
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none !important;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
  line-height: 1.4;
  white-space: nowrap;
}

a[role="button"].outline,
button.outline {
  background: transparent;
  border-color: var(--c-primary);
  color: var(--c-primary);
}

a[role="button"].outline:hover,
button.outline:hover {
  background: var(--c-primary);
  color: var(--c-white);
}

a[role="button"].outline.secondary {
  border-color: var(--c-muted);
  color: var(--c-text-2);
}

a[role="button"].outline.secondary:hover {
  background: var(--c-muted);
  color: var(--c-white);
}

/* ====== Breadcrumb ====== */
.doc-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.82rem;
  color: var(--c-muted);
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.doc-breadcrumb a {
  color: var(--c-primary);
}

/* ====== Action Bar (doc pages) ====== */
.doc-action-bar {
  background: linear-gradient(135deg, var(--c-primary-dk), var(--c-primary));
  color: var(--c-white);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.doc-action-bar strong {
  color: var(--c-white);
  font-size: 1.1rem;
}

.doc-action-bar small {
  color: rgba(255,255,255,0.8);
}

.doc-action-bar a[role="button"] {
  background: var(--c-white);
  color: var(--c-primary-dk);
  border-color: var(--c-white);
  font-weight: 700;
}

.doc-action-bar a[role="button"]:hover {
  background: rgba(255,255,255,0.9);
}

/* ====== Document Content ====== */
.doc-content {
  background: var(--c-white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--c-border);
  padding: 1.5rem;
  line-height: 1.9;
}

.doc-content h1 {
  text-align: center;
  font-size: 1.4rem;
  border-bottom: 3px solid var(--c-primary-lt);
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
}

.doc-content h2 {
  font-size: 1.2rem;
  color: var(--c-primary-dk);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--c-border);
}

.doc-content p {
  text-indent: 2em;
  margin-bottom: 0.6rem;
  font-size: 0.93rem;
}

.doc-content ol,
.doc-content ul {
  margin: 0.3rem 0 1rem 2em;
  font-size: 0.93rem;
}

.doc-content li {
  margin-bottom: 0.3rem;
}

.doc-content hr {
  border: none;
  border-top: 1px solid var(--c-border);
  margin: 1.5rem 0;
}

@media (min-width: 640px) {
  .doc-content {
    padding: 2rem 2.5rem;
  }
  .doc-content h1 {
    font-size: 1.6rem;
  }
}

/* ====== File List (download page) ====== */
.file-list {
  list-style: none;
}

.file-list li {
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.file-info {
  flex: 1;
  min-width: 0;
}

.file-info strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
}

.file-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

.file-actions a {
  font-size: 0.82rem;
  padding: 0.35rem 0.7rem;
}

/* ====== Legal Note ====== */
.legal-note {
  background: var(--c-warn-bg);
  border-left: 4px solid var(--c-warn);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.25rem;
}

.legal-note h3 {
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.legal-note p {
  font-size: 0.9rem;
  color: var(--c-text-2);
  margin: 0;
}

/* ====== Footer ====== */
.site-footer {
  background: var(--c-primary-dk);
  margin-top: auto;
  padding: 1.5rem 0;
}

.site-footer > nav {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.site-footer ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  justify-content: center;
}

.site-footer a {
  color: rgba(255,255,255,0.7) !important;
  font-size: 0.88rem;
}

.site-footer a:hover {
  color: var(--c-white) !important;
}

.footer-copy {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.45);
  margin: 0;
  text-align: center;
}

@media (min-width: 640px) {
  .site-footer > nav {
    flex-direction: row;
    justify-content: space-between;
    padding: 0 1.5rem;
  }
}

/* ====== Print ====== */
@media print {
  .site-header,
  .site-footer,
  .doc-action-bar,
  .nav-toggle {
    display: none !important;
  }
  .doc-content {
    border: none;
    padding: 0;
  }
  body {
    background: var(--c-white);
  }
}
