/* 墅研社 H5 全局样式 */
:root {
  --black: #1a1a18;
  --cream: #f5f0e8;
  --warm-white: #faf8f4;
  --brown: #8b7355;
  --light-brown: #c4a882;
  --warm-gray: #9e9690;
  --text: #3d3830;
  --subtle: #e8e2d9;
  --gold: #b89a6a;
  --gold-light: #d4b98a;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --radius: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--warm-white);
  line-height: 1.6;
  min-height: 100vh;
}

/* ====== Layout ====== */
.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
}

.page-wide {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
}

/* ====== Header ====== */
.header {
  text-align: center;
  padding: 40px 0 24px;
}

.header-logo {
  font-size: 14px;
  font-weight: 400;
  color: var(--gold);
  letter-spacing: 4px;
  margin-bottom: 8px;
}

.header-title {
  font-size: clamp(24px, 6vw, 32px);
  font-weight: 200;
  color: var(--black);
  line-height: 1.3;
}

.header-desc {
  font-size: 13px;
  color: var(--warm-gray);
  margin-top: 8px;
}

/* ====== Cards ====== */
.card {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--subtle);
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--black);
  margin-bottom: 12px;
}

.card-label {
  font-size: 11px;
  color: var(--gold);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

/* ====== Forms ====== */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  font-size: 15px;
  font-family: var(--font);
  border: 1px solid var(--subtle);
  border-radius: 10px;
  background: var(--warm-white);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease;
}

.form-input:focus {
  border-color: var(--gold);
}

.form-input::placeholder {
  color: #c0b8ae;
}

.form-select {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  font-size: 15px;
  font-family: var(--font);
  border: 1px solid var(--subtle);
  border-radius: 10px;
  background: var(--warm-white);
  color: var(--text);
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%239e9690'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.form-textarea {
  width: 100%;
  min-height: 100px;
  padding: 12px 16px;
  font-size: 15px;
  font-family: var(--font);
  border: 1px solid var(--subtle);
  border-radius: 10px;
  background: var(--warm-white);
  color: var(--text);
  outline: none;
  resize: vertical;
}

.form-textarea:focus {
  border-color: var(--gold);
}

/* ====== Buttons ====== */
.btn {
  display: block;
  width: 100%;
  height: 50px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  text-align: center;
  line-height: 50px;
}

.btn-primary {
  background: var(--black);
  color: white;
}

.btn-primary:hover {
  background: #2a2a28;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold-light);
}

.btn-secondary:hover {
  background: rgba(184,154,106,0.05);
}

.btn-danger {
  background: #e74c3c;
  color: white;
}

.btn-small {
  display: inline-block;
  height: 36px;
  line-height: 36px;
  padding: 0 20px;
  font-size: 13px;
  border-radius: 8px;
  width: auto;
}

/* ====== Toggle ====== */
.toggle-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.toggle-btn {
  padding: 8px 16px;
  border: 1px solid var(--subtle);
  border-radius: 8px;
  background: white;
  font-size: 13px;
  font-family: var(--font);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
}

.toggle-btn.active {
  background: var(--black);
  color: white;
  border-color: var(--black);
}

/* ====== Status / Messages ====== */
.success-msg {
  background: #e8f5e9;
  color: #2e7d32;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 12px;
}

.error-msg {
  background: #fbe9e7;
  color: #c62828;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 12px;
}

.info-msg {
  background: #e3f2fd;
  color: #1565c0;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 12px;
}

/* ====== Loading ====== */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--warm-gray);
  font-size: 14px;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--subtle);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 10px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ====== Navigation ====== */
.nav-bar {
  display: flex;
  align-items: center;
  height: 52px;
  padding: 0 4px;
  margin-bottom: 8px;
}

.nav-back {
  font-size: 22px;
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  line-height: 1;
}

.nav-title {
  flex: 1;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--black);
}

/* ====== Step indicator ====== */
.steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 16px 0;
}

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--subtle);
}

.step-dot.active {
  background: var(--gold);
  width: 24px;
  border-radius: 4px;
}

.step-dot.done {
  background: var(--gold);
}

/* ====== Table ====== */
.table-wrap {
  overflow-x: auto;
  margin-bottom: 16px;
}

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

th {
  background: var(--cream);
  color: var(--text);
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  border-bottom: 1px solid var(--subtle);
}

td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--subtle);
  color: var(--text);
}

tr:hover td {
  background: var(--cream);
}

/* ====== Admin Layout ====== */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 220px;
  background: var(--black);
  color: white;
  padding: 24px 0;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
}

.admin-sidebar .logo {
  padding: 0 20px 24px;
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--gold);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.admin-sidebar .nav-item {
  display: block;
  padding: 12px 20px;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s;
}

.admin-sidebar .nav-item:hover,
.admin-sidebar .nav-item.active {
  color: white;
  background: rgba(255,255,255,0.06);
}

.admin-main {
  margin-left: 220px;
  flex: 1;
  padding: 24px 32px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.admin-header h2 {
  font-size: 24px;
  font-weight: 300;
  color: var(--black);
}

/* Stats cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: white;
  border: 1px solid var(--subtle);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}

.stat-card .num {
  font-size: 32px;
  font-weight: 200;
  color: var(--black);
}

.stat-card .label {
  font-size: 12px;
  color: var(--warm-gray);
  margin-top: 4px;
}

/* ====== Responsive ====== */
@media (max-width: 640px) {
  .admin-sidebar { display: none; }
  .admin-main { margin-left: 0; padding: 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
