﻿:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #1f2a37;
  --muted: #6b7280;
  --line: #dbe2ea;
  --brand: #0f766e;
  --brand-dark: #0b4f4a;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: linear-gradient(90deg, #0f766e, #134e4a);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand { font-weight: 700; }
.mobile-menu-btn {
  display: none;
  width: auto;
  min-width: 72px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.45);
  background: rgba(255,255,255,0.15);
  color: #fff;
}
nav a {
  color: #fff;
  margin-left: 16px;
  text-decoration: none;
}

.container {
  max-width: 1200px;
  margin: 20px auto;
  padding: 0 12px;
  width: 100%;
  flex: 1;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 14px;
}

.auth-card { max-width: 420px; margin: 40px auto; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.stat strong { font-size: 28px; color: var(--brand-dark); }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
}

.form-grid {
  display: grid;
  gap: 8px;
}

.form-grid.cols-3 {
  grid-template-columns: 110px minmax(180px, 1fr) 110px minmax(180px, 1fr) 110px minmax(180px, 1fr);
  column-gap: 10px;
  row-gap: 10px;
  align-items: center;
}

.form-grid.cols-3 > label {
  margin: 0;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
}

.form-grid.cols-3 > button {
  grid-column: 1 / -1;
  width: auto;
  min-width: 220px;
  justify-self: start;
}

@media (max-width: 900px) {
  .form-grid.cols-3 {
    grid-template-columns: 100px minmax(0, 1fr);
  }
  .form-grid.cols-3 > button {
    grid-column: 1 / -1;
    width: 100%;
  }
}

.inline-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

input, select, textarea, button {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
}

button {
  background: var(--brand);
  color: #fff;
  border: none;
  cursor: pointer;
}

button:hover { background: var(--brand-dark); }

.small-btn {
  width: auto;
  min-width: 84px;
  display: inline-block;
  padding: 6px 10px;
  font-size: 13px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th, td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 8px;
  vertical-align: top;
}

.muted { color: var(--muted); }

.flash-wrap { margin-bottom: 12px; }
.flash {
  background: #ecfeff;
  border: 1px solid #99f6e4;
  color: #0f766e;
  padding: 8px;
  border-radius: 8px;
  margin-bottom: 6px;
}

.reply-box { border: 1px dashed var(--line); padding: 8px; border-radius: 8px; margin-bottom: 8px; }

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(80px, 1fr));
  gap: 6px;
}

.thumb {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
}

.dropzone {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 10px;
  color: var(--muted);
  text-align: center;
  background: #fafcfd;
  cursor: pointer;
}

.dropzone.dragover {
  border-color: var(--brand);
  color: var(--brand-dark);
  background: #eefaf7;
}

.icp-footer {
  width: 100%;
  text-align: center;
  padding: 12px 8px 16px;
  font-size: 12px;
  color: var(--muted);
}

.icp-footer a {
  color: var(--muted);
  text-decoration: none;
}

.icp-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  body {
    font-size: 15px;
  }
  .topbar {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
  }
  .mobile-menu-btn {
    display: inline-block;
  }
  .topbar nav {
    width: 100%;
    display: none;
    padding-top: 6px;
  }
  .topbar nav.open {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .topbar nav a {
    margin-left: 0;
    display: block;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(255,255,255,0.12);
  }
  .container {
    margin: 10px auto;
    padding: 0 8px 10px;
  }
  .card {
    padding: 10px;
    border-radius: 8px;
  }
  h1 {
    font-size: 22px;
    margin: 8px 0 10px;
  }
  h2 {
    font-size: 18px;
    margin: 8px 0;
  }
  input, select, textarea, button {
    min-height: 44px;
    font-size: 16px;
  }
  .inline-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .inline-form > * {
    width: 100%;
  }
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
  .thumb {
    width: 78px;
    height: 78px;
  }
}

@media (min-width: 901px) {
  .topbar nav {
    display: block !important;
  }
}
