﻿/* ==========================================================================
   花钱OA · 设计系统
   取色与尺度来自「可交互原型（design reference）」，并补齐交互状态。
   ========================================================================== */

:root {
  /* 品牌色 */
  --navy: #24344b;
  --navy-soft: #2e425c;
  --navy-deep: #1b2839;
  --paper: #f6f4ef;
  --canvas: #eae3d3;
  --card: #ffffff;

  /* 语义色 */
  --orange: #e76a51;
  --orange-ink: #c2482f;
  --orange-soft: #fbe3dc;
  --green: #2dad75;
  --green-ink: #17794d;
  --green-soft: #ddf3e8;

  /* 中性色 */
  --ink: #24344b;
  --ink-2: #3c4b5f;
  --muted: #57606e;
  --muted-2: #7c8696;
  --line: #e7e2d6;
  --line-strong: #d9d3c3;
  --sand: #efebdd;
  --sand-soft: #f1ede1;
  --danger: #a63b26;

  /* 尺度 */
  --r-card: 18px;
  --r-btn: 14px;
  --r-field: 12px;
  --shadow-card: 0 10px 22px -16px rgba(36, 52, 75, 0.45);
  --shadow-float: 0 18px 40px -20px rgba(36, 52, 75, 0.5);
  --shadow-sheet: 0 -18px 48px -24px rgba(20, 27, 38, 0.55);

  /* 字体 */
  --font-cn: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-num: "DIN Alternate", "Bahnschrift", "Helvetica Neue", Arial, sans-serif;

  --nav-h: 64px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: #ebe5d9;
  color: var(--ink);
  font-family: var(--font-cn);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  justify-content: center;
  overscroll-behavior: none;
}

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

input,
textarea,
select {
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

/* --------------------------------------------------------------------------
   应用外壳：手机优先，桌面端居中呈现为一条 430px 的应用栏
   -------------------------------------------------------------------------- */

.app {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 430px;
  height: 100dvh;
  background: var(--canvas);
  overflow: hidden;
}

@media (min-width: 520px) {
  body {
    padding: 22px 0;
    background:
      radial-gradient(900px 520px at 50% -10%, #f7f2e7 0%, rgba(247, 242, 231, 0) 70%),
      linear-gradient(160deg, #efe9dd 0%, #e3dbcb 100%);
  }

  .app {
    height: calc(100dvh - 44px);
    border-radius: 34px;
    box-shadow:
      0 40px 80px -32px rgba(36, 52, 75, 0.45),
      0 0 0 1px rgba(36, 52, 75, 0.07);
  }
}

.page {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.page::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.page.is-locked {
  overflow: hidden;
}

.view {
  min-height: 100%;
  padding-bottom: 26px;
  animation: view-in 0.2s ease both;
}

@keyframes view-in {
  from {
    opacity: 0.4;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.pad {
  padding-left: 16px;
  padding-right: 16px;
}

/* --------------------------------------------------------------------------
   底部导航
   -------------------------------------------------------------------------- */

.nav {
  flex: none;
  display: flex;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: #fff;
  border-top: 1px solid var(--line);
  z-index: 20;
}

.nav__btn {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
  transition: color 0.15s;
}

.nav__btn.on {
  color: var(--navy);
}

.nav__btn.on::before {
  content: "";
  position: absolute;
  top: 0;
  width: 30px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--orange);
}

.nav__btn .ico {
  width: 24px;
  height: 24px;
}

.nav__btn:active {
  background: #faf8f3;
}

/* --------------------------------------------------------------------------
   基础组件
   -------------------------------------------------------------------------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  padding: 0 18px;
  border-radius: var(--r-btn);
  background: var(--navy);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.2px;
  transition: transform 0.15s, filter 0.15s, opacity 0.15s;
}

.btn:hover {
  filter: brightness(1.09);
}

.btn:active {
  transform: scale(0.99);
}

.btn:disabled,
.btn.is-dim {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
  transform: none;
}

.btn--ghost {
  background: #fff;
  border: 1.5px solid var(--line-strong);
  color: var(--ink);
}

.btn--ghost:hover {
  border-color: var(--navy);
  filter: none;
}

.btn--sm {
  min-height: 44px;
  font-size: 14px;
  border-radius: 12px;
  width: auto;
  padding: 0 16px;
}

.btn--inline {
  width: auto;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--ink);
  transition: background 0.15s;
}

.icon-btn:active {
  background: var(--sand-soft);
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 40px;
  padding: 0 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.link-btn--accent {
  color: var(--orange-ink);
}

.link-btn--under {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.pill--wait {
  background: var(--sand-soft);
  color: var(--muted);
}

.pill--pending {
  background: #e1e7f0;
  color: var(--navy);
}

.pill--ok {
  background: var(--green-soft);
  color: var(--green-ink);
}

.pill--no {
  background: var(--orange-soft);
  color: var(--danger);
}

.pill--tie {
  background: var(--sand);
  color: var(--muted);
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--sand-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.tag--hot {
  background: var(--orange-soft);
  color: var(--danger);
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.badge--ok {
  background: var(--green-soft);
  color: var(--green-ink);
}

.badge--no {
  background: var(--orange-soft);
  color: var(--danger);
}

/* 印章：整套界面的记忆点 */
.stamp {
  position: absolute;
  top: 15px;
  right: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  padding: 6px;
  border: 3px double currentColor;
  border-radius: 50%;
  color: var(--orange-ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 1px;
  text-align: center;
  transform: rotate(-12deg);
  opacity: 0.94;
  pointer-events: none;
}

.stamp--ok {
  color: var(--green-ink);
}

.stamp--no {
  color: var(--danger);
}

.stamp--tie,
.stamp--wait {
  color: var(--muted);
}

.stamp--enter {
  animation: stamp-in 0.5s cubic-bezier(0.2, 0.85, 0.3, 1) both;
}

@keyframes stamp-in {
  0% {
    transform: rotate(-12deg) scale(1.7);
    opacity: 0;
  }
  60% {
    transform: rotate(-12deg) scale(0.96);
    opacity: 0.94;
  }
  100% {
    transform: rotate(-12deg) scale(1);
    opacity: 0.94;
  }
}

/* 表单 */
.field {
  margin-top: 16px;
}

.field__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.field__label {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.field__req {
  color: var(--orange-ink);
}

.field__count {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.fld {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 12px 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-field);
  background: #fbfaf6;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  resize: none;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.fld::placeholder {
  color: var(--muted-2);
}

.fld:focus {
  border-color: var(--navy);
  background: #fff;
  outline: none;
  box-shadow: 0 0 0 3px rgba(36, 52, 75, 0.08);
}

.fld--err {
  border-color: var(--danger);
  background: #fff6f3;
}

.err {
  margin-top: 6px;
  color: var(--danger);
  font-size: 12.5px;
  line-height: 1.5;
}

.err:empty {
  display: none;
}

.amount-field {
  position: relative;
}

.amount-field .cur {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--orange-ink);
  font-size: 22px;
  font-weight: 700;
  pointer-events: none;
}

.amount-field .fld {
  padding-left: 36px;
  font-family: var(--font-num);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.cat {
  height: 40px;
  padding: 0 15px;
  border: 1.5px solid var(--line-strong);
  border-radius: 20px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.15s;
}

.cat.on {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

/* 分段控件 */
.seg {
  display: flex;
  padding: 3px;
  border-radius: 12px;
  background: var(--sand);
}

.seg__btn {
  flex: 1;
  min-height: 40px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.15s;
}

.seg__btn.on {
  background: #fff;
  color: var(--navy);
  box-shadow: 0 1px 3px rgba(36, 52, 75, 0.18);
}

/* 按钮组 */
.choice {
  display: flex;
  gap: 10px;
}

.choice__btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 64px;
  padding: 0 8px;
  border: 2px solid var(--line-strong);
  border-radius: 16px;
  background: #fff;
  font-size: 16px;
  font-weight: 700;
  transition: all 0.16s;
}

.choice__btn--ok {
  border-color: #bfe3d1;
  color: var(--green-ink);
}

.choice__btn--no {
  border-color: #f2c4b9;
  color: var(--danger);
}

.choice__btn--ok.on {
  background: #1b7f53;
  border-color: #1b7f53;
  color: #fff;
}

.choice__btn--no.on {
  background: var(--orange-ink);
  border-color: var(--orange-ink);
  color: #fff;
}

.choice__btn:active {
  transform: scale(0.985);
}

/* 进度条 */
.bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  background: #e9e4d6;
  overflow: hidden;
}

.bar--lg {
  height: 10px;
  border-radius: 5px;
}

.bar__ok {
  background: var(--green);
}

.bar__no {
  background: var(--orange);
}

/* 头像 */
.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 700;
}

.avatar--ok {
  background: var(--green-soft);
  color: var(--green-ink);
}

.avatar--no {
  background: var(--orange-soft);
  color: var(--danger);
}

/* 提示条 */
.notice {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--sand);
  color: #4b5565;
  font-size: 13px;
  line-height: 1.6;
}

.notice .ico {
  flex: none;
  margin-top: 2px;
}

.notice b {
  color: var(--ink);
}

.notice--warn {
  background: var(--orange-soft);
  color: var(--danger);
}

/* 空状态 */
.empty {
  padding: 34px 20px;
  border: 2px dashed var(--line-strong);
  border-radius: var(--r-card);
  text-align: center;
}

.empty__icon {
  display: inline-flex;
  color: var(--orange-ink);
  opacity: 0.85;
}

.empty__title {
  margin-top: 12px;
  font-size: 17px;
  font-weight: 800;
}

.empty__desc {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.empty__action {
  margin-top: 16px;
}

/* 章节标题 */
.sec {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 22px 16px 10px;
}

.sec__title {
  font-size: 17px;
  font-weight: 800;
}

.sec__meta {
  color: var(--muted);
  font-size: 13px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 16px;
}

/* Toast */
.spinner {
  width: 18px;
  height: 18px;
  flex: none;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.toast {
  position: absolute;
  left: 50%;
  bottom: calc(var(--nav-h) + 20px);
  z-index: 60;
  max-width: calc(100% - 56px);
  padding: 11px 18px;
  border-radius: 22px;
  background: var(--navy);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  box-shadow: var(--shadow-float);
  transform: translate(-50%, 8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}

.toast.on {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* 遮罩层：约束在应用栏内 */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.overlay--center {
  justify-content: center;
  padding: 20px;
}

.overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 27, 38, 0.55);
  backdrop-filter: blur(3px);
  animation: fade-in 0.2s ease both;
}

.sheet {
  position: relative;
  max-height: 90%;
  overflow-y: auto;
  padding: 8px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  border-radius: 24px 24px 0 0;
  background: var(--paper);
  box-shadow: var(--shadow-sheet);
  animation: sheet-up 0.26s cubic-bezier(0.2, 0.9, 0.3, 1) both;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.sheet::-webkit-scrollbar {
  width: 0;
}

.sheet__grab {
  width: 38px;
  height: 4px;
  margin: 0 auto 10px;
  border-radius: 2px;
  background: var(--line-strong);
}

.sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 0 0;
}

.sheet__title {
  font-size: 18px;
  font-weight: 800;
}

.sheet__foot {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

@keyframes sheet-up {
  from {
    transform: translateY(24px);
    opacity: 0.6;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* 居中弹层 */
.modal {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal__panel {
  position: relative;
  width: 100%;
  max-height: 86%;
  overflow-y: auto;
  padding: 20px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 60px -20px rgba(20, 27, 38, 0.5);
  animation: modal-in 0.2s ease both;
  scrollbar-width: none;
}

.modal__panel::-webkit-scrollbar {
  width: 0;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.modal__title {
  font-size: 18px;
  font-weight: 800;
}

.modal__text {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.modal__actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.modal__actions > * {
  flex: 1;
}

/* 单选列表（举报原因等） */
.radio-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.radio-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: 12px;
  background: #fbfaf6;
  font-size: 14px;
  text-align: left;
  transition: all 0.15s;
}

.radio-row.on {
  border-color: var(--navy);
  background: #fff;
  font-weight: 700;
}

.radio-dot {
  width: 18px;
  height: 18px;
  flex: none;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  background: #fff;
}

.radio-row.on .radio-dot {
  border: 5px solid var(--navy);
}

/* 通用排版工具 */
.num {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.4px;
}

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

.nowrap {
  white-space: nowrap;
}

.line-1,
.line-2,
.line-3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-1 {
  -webkit-line-clamp: 1;
}

.line-2 {
  -webkit-line-clamp: 2;
}

.line-3 {
  -webkit-line-clamp: 3;
}

/* 动效降级 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
/* --------------------------------------------------------------------------
   小号印章：列表卡片、表单卡片右上角那一枚
   -------------------------------------------------------------------------- */

.seal {
  position: absolute;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  padding: 7px;
  border: 2px solid currentColor;
  border-radius: 50%;
  color: var(--danger);
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0.3px;
  text-align: center;
  transform: rotate(-12deg);
  opacity: 0.92;
  pointer-events: none;
}

.seal::after {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid currentColor;
  border-radius: 50%;
  opacity: 0.55;
}

.seal--ok {
  color: var(--green-ink);
}

.seal--no {
  color: var(--danger);
}

.seal--pending {
  color: var(--orange-ink);
}

.seal--wait,
.seal--tie {
  color: var(--muted);
}

.seal--sm {
  width: 46px;
  height: 46px;
  padding: 5px;
  font-size: 9.5px;
}
