/* =============================================================================
   世紀21 VR360 — 基礎樣式、設計變數、共用元件
   ============================================================================= */

:root {
  --c21-gold: #c8a24a;
  --c21-gold-light: #e0c884;
  --c21-gold-dim: #8d7333;
  --ink-900: #0d1117;
  --ink-800: #161b22;
  --ink-700: #1f262f;
  --ink-600: #2a3441;
  --ink-500: #3d4a5c;
  --line: #e3e7ed;
  --line-dark: #2b3442;
  --text: #1c2430;
  --text-muted: #6a7688;
  --text-invert: #f2f5f9;
  --text-invert-muted: #9aa8bb;
  --danger: #d1345b;
  --success: #2e9e6b;
  --warn: #d99a1f;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-md: 0 4px 16px rgba(16, 24, 40, .1);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, .18);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans HK",
          "PingFang HK", "Microsoft JhengHei", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  color: var(--text);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

body { line-height: 1.6; }

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

.hidden { display: none !important; }

/* ---------------------------------------------------------------- 按鈕 */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s, opacity .15s;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { background: #f5f7fa; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-primary {
  background: var(--c21-gold);
  border-color: var(--c21-gold);
  color: #14191f;
  font-weight: 600;
}
.btn-primary:hover:not(:disabled) { background: var(--c21-gold-light); border-color: var(--c21-gold-light); }

.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b82a4d; border-color: #b82a4d; }

.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-xs { padding: 3px 8px; font-size: 12px; }

.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, .08); }

/* ---------------------------------------------------------------- 表單 */

.field { margin-bottom: 14px; }

.field > label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.input, .field input[type="text"], .field input[type="number"],
.field select, .field textarea {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--c21-gold);
  box-shadow: 0 0 0 3px rgba(200, 162, 74, .16);
}
.field textarea { resize: vertical; min-height: 68px; line-height: 1.5; }

.field-row { display: flex; gap: 10px; }
.field-row > * { flex: 1; min-width: 0; }

.hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; line-height: 1.45; }

/* ---------------------------------------------------------------- 徽章 */

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  background: #eef1f5;
  color: var(--text-muted);
}
.badge-gold { background: rgba(200, 162, 74, .16); color: var(--c21-gold-dim); }
.badge-danger { background: rgba(209, 52, 91, .12); color: var(--danger); }
.badge-success { background: rgba(46, 158, 107, .13); color: var(--success); }

/* ---------------------------------------------------------------- 狀態列 */

.notice {
  padding: 9px 13px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid transparent;
}
.notice-info { background: #eef4fb; border-color: #cfe0f3; color: #24506f; }
.notice-success { background: rgba(46, 158, 107, .1); border-color: rgba(46, 158, 107, .3); color: #1d7a51; }
.notice-error { background: rgba(209, 52, 91, .1); border-color: rgba(209, 52, 91, .3); color: #a82647; }
.notice-warn { background: rgba(217, 154, 31, .1); border-color: rgba(217, 154, 31, .3); color: #96690e; }

/* ---------------------------------------------------------------- 載入中 */

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, .25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
.spinner-dark { border-color: rgba(0, 0, 0, .15); border-top-color: var(--c21-gold); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- Modal */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(9, 13, 20, .62);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(2px);
}
.modal {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-width: 460px;
  width: 100%;
  max-height: 88vh;
  overflow: auto;
}
.modal-header {
  padding: 16px 20px 0;
  font-size: 17px;
  font-weight: 700;
}
.modal-body { padding: 14px 20px; font-size: 14px; color: #37415180; color: #374151; }
.modal-footer {
  padding: 12px 20px 18px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ---------------------------------------------------------------- 進度條 */

.progress {
  height: 6px;
  background: rgba(0, 0, 0, .1);
  border-radius: 999px;
  overflow: hidden;
}
.progress > i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--c21-gold);
  border-radius: 999px;
  transition: width .2s ease;
}

/* ---------------------------------------------------------------- 頂部品牌列 */

.brandbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  height: 62px;
  background: var(--ink-900);
  border-bottom: 1px solid var(--line-dark);
}
.brandbar img { height: 30px; width: auto; }
.brandbar .brand-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--c21-gold-light);
  letter-spacing: .06em;
}
.brandbar .brand-sub {
  font-size: 12px;
  color: var(--text-invert-muted);
  border-left: 1px solid var(--line-dark);
  padding-left: 12px;
  margin-left: 2px;
}
.brandbar .spacer { flex: 1; }
