:root {
  --bg: #F5F5F5;
  --card: #FFFFFF;
  --ink: #2C2C2C;
  --ink-2: #6B6B6B;
  --ink-3: #9E9E9E;
  --accent: #E8734A;
  --accent-deep: #D8613A;
  --accent-soft: #FBEFEA;
  --line: #ECECEC;
  --line-strong: #E0E0E0;
  --green: #3E9B6A;
  --green-soft: #EAF5EF;
  --red: #C9574E;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 6px 24px rgba(44, 44, 44, 0.05);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
          "Source Han Sans SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }

.hidden { display: none !important; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.accent { color: var(--accent); }
.green { color: var(--green); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.bold { font-weight: 600; }
.center { text-align: center; }
.row { display: flex; align-items: center; }
.between { display: flex; align-items: center; justify-content: space-between; }
.stack { display: flex; flex-direction: column; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--card);
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  transition: opacity .15s ease, background .15s ease;
  user-select: none;
}
.btn:active { opacity: .82; }
.btn[disabled], .btn.disabled { opacity: .45; pointer-events: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:active { background: var(--accent-deep); }
.btn-outline { border-color: var(--accent); color: var(--accent); background: #fff; }
.btn-line { border-color: var(--line-strong); color: var(--ink); background: #fff; }
.btn-quiet { background: transparent; color: var(--ink-2); min-height: 40px; padding: 0 10px; }
.btn-block { width: 100%; }
.btn-lg { height: 48px; font-size: 16px; border-radius: 12px; }

.field { margin-bottom: 16px; }
.field label.label {
  display: block;
  font-size: 13px;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.input, .textarea, .select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 12px 14px;
  min-height: 46px;
  outline: none;
  transition: border-color .15s ease;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--accent); }
.textarea { min-height: 88px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.help { font-size: 12px; color: var(--ink-3); margin-top: 6px; line-height: 1.6; }
.error-text { font-size: 12px; color: var(--red); margin-top: 6px; }

.checkline {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.6;
}
.checkline input[type="checkbox"] {
  width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent);
  flex: 0 0 auto;
}
.link { color: var(--accent); }

.tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 6px;
  font-size: 12px;
  background: #F2F2F2;
  color: var(--ink-2);
  white-space: nowrap;
}
.tag-orange { background: var(--accent-soft); color: var(--accent); }
.tag-green { background: var(--green-soft); color: var(--green); }
.tag-grey { background: #F0F0F0; color: var(--ink-2); }

.divider { height: 1px; background: var(--line); margin: 16px 0; }

.empty {
  padding: 56px 20px;
  text-align: center;
  color: var(--ink-3);
  font-size: 13px;
}
.empty .empty-mark {
  width: 44px; height: 44px; margin: 0 auto 12px;
  border: 1.5px solid var(--line-strong); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-3); font-size: 20px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 88px;
  transform: translateX(-50%) translateY(8px);
  background: rgba(44, 44, 44, .92);
  color: #fff;
  font-size: 13px;
  line-height: 1.5;
  padding: 10px 16px;
  border-radius: 8px;
  max-width: 80vw;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.modal-mask {
  position: fixed; inset: 0; background: rgba(30, 30, 30, .42);
  display: flex; align-items: center; justify-content: center;
  z-index: 1500; padding: 20px;
}
.modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 420px;
  max-height: 86vh; overflow: auto; padding: 22px;
  box-shadow: 0 20px 60px rgba(0,0,0,.16);
}
.modal h3 { margin: 0 0 6px; font-size: 18px; }
.modal .modal-body { margin: 14px 0 18px; }
.modal .modal-actions { display: flex; gap: 10px; }
.modal .modal-actions .btn { flex: 1; }

.loading-line {
  height: 2px; width: 100%; background: var(--line); overflow: hidden;
}
.loading-line::after {
  content: ""; display: block; height: 100%; width: 40%;
  background: var(--accent); animation: slide 1.1s infinite ease-in-out;
}
@keyframes slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}
