/* ============================================================
   芙湘东方高校联合THP活动网站 - 样式表
   东方动漫可爱风 + 简约主题，移动端优先
   ============================================================ */
:root {
  --red: #e05a6d;
  --red-deep: #c94b5f;
  --red-soft: #ffd9e0;
  --pink-bg: #fff1f4;
  --cream: #fffaf7;
  --ink: #5a3a3a;
  --ink-soft: #94707b;
  --ink-faint: #c9b2b8;
  --gold: #e8b04b;
  --green: #4cae74;
  --blue: #6b8cd9;
  --radius: 16px;
  --shadow: 0 8px 30px rgba(224, 90, 109, .10);
  --nav-h: 60px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  color: var(--ink);
  background: linear-gradient(160deg, #fff7f8 0%, #ffeef3 45%, #f6f1ff 100%);
  background-attachment: fixed;
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.65;
}
a { color: var(--red-deep); text-decoration: none; }
h1, h2, h3, h4 { margin: 0 0 8px; line-height: 1.35; }
p { margin: 6px 0; }
input, button, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--ink-soft); font-size: 13px; }
.center { text-align: center; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; } .mb16 { margin-bottom: 16px; }
.flex { display: flex; align-items: center; } .flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap8 { gap: 8px; } .gap12 { gap: 12px; } .wrap { flex-wrap: wrap; }
.grow { flex: 1; }

/* ---------- 加载层 ---------- */
.thp-loading {
  position: fixed; inset: 0; z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #fff6f8, #ffe9f0);
  transition: opacity .35s ease;
}
.thp-loading.hide { opacity: 0; pointer-events: none; }
.thp-loading-inner { text-align: center; }
.thp-loading-coin { width: 74px; height: 74px; animation: thpCoinSpin 1.6s ease-in-out infinite; }
.thp-loading-text { margin-top: 14px; color: var(--red-deep); font-weight: 700; letter-spacing: 1px; }
@keyframes thpCoinSpin {
  0% { transform: rotateY(0deg) translateY(0); }
  50% { transform: rotateY(180deg) translateY(-8px); }
  100% { transform: rotateY(360deg) translateY(0); }
}

/* ---------- 布局 ---------- */
.app-shell { max-width: 780px; margin: 0 auto; padding: 14px 14px calc(var(--nav-h) + 40px); }
.thp-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 4px 4px; gap: 10px;
}
.thp-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.thp-brand img { width: 40px; height: 40px; flex: none; }
.thp-brand .name { font-weight: 800; font-size: 16px; color: var(--red-deep); letter-spacing: .5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.balance-chip {
  display: flex; align-items: center; gap: 6px; background: #fff; border-radius: 999px;
  padding: 6px 14px 6px 8px; box-shadow: var(--shadow); font-weight: 800; color: var(--red-deep); flex: none;
}
.balance-chip img { width: 24px; height: 24px; }
.balance-chip small { font-weight: 600; color: var(--ink-soft); }

/* 底部导航（移动端） */
.thp-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 800;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(12px);
  border-top: 1px solid #f6e3e8;
  display: flex; justify-content: space-around; align-items: center;
}
.thp-nav .nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 11px; color: var(--ink-soft); cursor: pointer; padding: 6px 0; user-select: none;
  transition: color .15s;
}
.thp-nav .nav-item svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.thp-nav .nav-item.active { color: var(--red-deep); font-weight: 700; }

/* 桌面端导航 */
@media (min-width: 860px) {
  .app-shell { max-width: 980px; padding-bottom: 40px; }
  .thp-nav {
    position: sticky; top: 0; bottom: auto; height: auto; padding: 6px 0;
    justify-content: center; gap: 8px; border-top: none; border-bottom: 1px solid #f6e3e8;
  }
  .thp-nav .nav-item { flex: none; flex-direction: row; gap: 6px; font-size: 14px; padding: 8px 18px; border-radius: 12px; }
  .thp-nav .nav-item.active { background: var(--pink-bg); }
}

/* ---------- 卡片 / 按钮 / 输入 ---------- */
.card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-top: 14px; }
.card-title { font-size: 16px; font-weight: 800; color: var(--red-deep); display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.card-title .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); flex: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: none; border-radius: 12px; padding: 11px 18px; font-size: 15px; font-weight: 700;
  background: var(--red); color: #fff; cursor: pointer; transition: filter .15s, transform .05s;
  box-shadow: 0 6px 18px rgba(224, 90, 109, .28);
}
.btn:active { transform: scale(.97); }
.btn:hover { filter: brightness(1.05); }
.btn[disabled] { opacity: .55; cursor: not-allowed; box-shadow: none; }
.btn.ghost { background: #fff; color: var(--red-deep); border: 1.5px solid var(--red-soft); box-shadow: none; }
.btn.green { background: var(--green); box-shadow: 0 6px 18px rgba(76, 174, 116, .25); }
.btn.gold { background: var(--gold); box-shadow: 0 6px 18px rgba(232, 176, 75, .25); }
.btn.blue { background: var(--blue); box-shadow: 0 6px 18px rgba(107, 140, 217, .25); }
.btn.danger { background: #d9534f; }
.btn.small { padding: 6px 12px; font-size: 13px; border-radius: 9px; box-shadow: none; }
.btn.block { width: 100%; }
.btn.big { padding: 14px 20px; font-size: 16px; border-radius: 14px; }

.input, textarea.input, select.input {
  width: 100%; padding: 11px 14px; border: 1.5px solid #f0d8de; border-radius: 12px;
  background: #fffdfd; font-size: 15px; outline: none; transition: border-color .15s;
}
.input:focus { border-color: var(--red); }
textarea.input { min-height: 110px; resize: vertical; line-height: 1.6; }
.field { margin-top: 12px; }
.field > label { display: block; font-size: 13px; font-weight: 700; color: var(--ink-soft); margin-bottom: 5px; }
.input-code {
  text-align: center; font-size: 26px; font-weight: 800; letter-spacing: 10px;
  font-family: ui-monospace, Consolas, monospace; padding: 12px 6px 12px 16px;
}

/* 分段选项卡 */
.segs { display: flex; background: #ffe9ee; border-radius: 13px; padding: 4px; gap: 4px; }
.seg {
  flex: 1; text-align: center; padding: 9px 6px; border-radius: 10px; cursor: pointer;
  font-weight: 700; color: var(--ink-soft); font-size: 14px; user-select: none; transition: all .15s;
}
.seg.active { background: #fff; color: var(--red-deep); box-shadow: 0 3px 12px rgba(224, 90, 109, .15); }

/* 徽标 / 状态 */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.ok { background: #e8f7ee; color: #2e8a52; }
.badge.warn { background: #fff5e0; color: #b07c1e; }
.badge.err { background: #ffe9ec; color: #c94b5f; }
.badge.gray { background: #f2edf0; color: #8a7681; }

/* 提示条 */
.notice { border-radius: 12px; padding: 10px 14px; font-size: 13.5px; margin-top: 12px; }
.notice.warn { background: #fff7e6; color: #9a7016; border: 1px solid #f4dfb0; }
.notice.err { background: #fff1f2; color: #c94b5f; border: 1px solid #f8c9d1; }
.notice.info { background: #eef4ff; color: #43619f; border: 1px solid #cfddf7; }

/* Toast */
#toast-root { position: fixed; top: 18px; left: 0; right: 0; z-index: 9500; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  max-width: min(86vw, 420px); padding: 11px 20px; border-radius: 999px; font-weight: 700; font-size: 14px;
  background: rgba(70, 40, 50, .92); color: #fff; box-shadow: 0 10px 30px rgba(90, 40, 55, .25);
  animation: toastIn .25s ease; display: flex; align-items: center; gap: 8px;
}
.toast.ok { background: linear-gradient(135deg, #4cae74, #3d9a63); }
.toast.err { background: linear-gradient(135deg, #e05a6d, #c94b5f); }
.toast.info { background: linear-gradient(135deg, #7f8ce0, #6b7ad9); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }

/* Modal */
.modal-mask {
  position: fixed; inset: 0; z-index: 9100; background: rgba(80, 45, 55, .35);
  backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 18px;
  animation: maskIn .18s ease;
}
@keyframes maskIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff; border-radius: 20px; padding: 20px; width: 100%; max-width: 440px;
  max-height: 86vh; overflow: auto; box-shadow: 0 24px 70px rgba(90, 40, 55, .3);
  animation: modalIn .22s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
.modal h3 { color: var(--red-deep); font-size: 17px; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions .btn { flex: 1; }

/* 表格 */
.table-wrap { overflow-x: auto; margin-top: 8px; }
table.thp-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 560px; }
table.thp-table th { text-align: left; color: var(--ink-soft); font-weight: 700; padding: 8px 8px; border-bottom: 1.5px solid #f4dfe4; white-space: nowrap; }
table.thp-table td { padding: 8px 8px; border-bottom: 1px solid #faedf0; vertical-align: middle; }
table.thp-table tr:hover td { background: #fffafb; }

/* 空状态 */
.empty { text-align: center; color: var(--ink-faint); padding: 26px 10px; font-size: 14px; }
.empty .big { font-size: 30px; display: block; margin-bottom: 6px; }

/* 小工具 */
.spin { display: inline-block; width: 16px; height: 16px; border: 2.5px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.hr { height: 1px; background: #f6e5e9; margin: 14px 0; border: none; }
.list-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 2px; border-bottom: 1px solid #faf0f2; }
.list-item:last-child { border-bottom: none; }
.code-big { font-family: ui-monospace, Consolas, monospace; font-size: 34px; font-weight: 800; letter-spacing: 8px; color: var(--red-deep); text-align: center; padding: 6px 0 2px 8px; }
.qr-box { display: flex; align-items: center; justify-content: center; padding: 12px 0; }
.qr-box img, .qr-box canvas { border-radius: 10px; }
.pill-price { font-weight: 800; font-family: ui-monospace, Consolas, monospace; }
.up { color: #d9483f; } .down { color: #2e8a52; }

/* ============ 主界面 ============ */
.hero {
  position: relative; border-radius: 22px; overflow: hidden; margin-top: 14px;
  min-height: 210px; display: flex; align-items: flex-end;
  background-image: url('../img/bg.svg'); background-size: cover; background-position: center;
  box-shadow: var(--shadow);
}
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,0) 30%, rgba(90, 40, 55, .38)); }
.hero-inner { position: relative; z-index: 2; padding: 20px; color: #fff; width: 100%; }
.hero-inner h2 { font-size: 21px; margin: 0 0 4px; text-shadow: 0 2px 10px rgba(90, 40, 55, .4); }
.hero-inner .sub { font-size: 13px; opacity: .95; text-shadow: 0 1px 6px rgba(90, 40, 55, .4); }
.hero-flower { position: absolute; top: 16px; right: 18px; width: 56px; opacity: .95; z-index: 2; animation: floatY 4s ease-in-out infinite; }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 14px; }
.quick-card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 15px;
  display: flex; align-items: center; gap: 12px; cursor: pointer; transition: transform .12s;
}
.quick-card:active { transform: scale(.97); }
.quick-card img { width: 42px; height: 42px; }
.quick-card .t { font-weight: 800; color: var(--red-deep); }
.quick-card .d { font-size: 12px; color: var(--ink-soft); }

.announcement { white-space: pre-wrap; color: #6b4c56; font-size: 14.5px; }

/* ============ 登录 ============ */
.auth-wrap { max-width: 430px; margin: 0 auto; padding-top: 4vh; }
.auth-logo { text-align: center; margin-bottom: 6px; }
.auth-logo img { width: 88px; height: 88px; }
.auth-title { text-align: center; color: var(--red-deep); font-weight: 800; font-size: 19px; }
.auth-sub { text-align: center; color: var(--ink-soft); font-size: 12.5px; margin-bottom: 14px; }
.captcha-row { display: flex; gap: 10px; align-items: stretch; }
.captcha-row .input { flex: 1; }
.captcha-img {
  width: 132px; height: 46px; border-radius: 10px; border: 1.5px solid #f0d8de;
  cursor: pointer; background: #fff; flex: none; object-fit: cover;
}
.auth-switch { text-align: center; margin-top: 14px; font-size: 14px; }
.auth-switch a { font-weight: 700; cursor: pointer; }
.auth-quote { text-align: center; color: var(--ink-faint); font-size: 12px; margin-top: 18px; }

/* ============ 代币页 ============ */
.panel { margin-top: 14px; }
.big-code-input-wrap { max-width: 300px; margin: 14px auto 0; }
.scan-hint { font-size: 12px; color: var(--ink-faint); text-align: center; margin-top: 8px; }
.quiz-option {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 12px;
  border: 1.5px solid #f0d8de; margin-top: 9px; cursor: pointer; transition: all .15s; background: #fffdfd;
}
.quiz-option:hover { border-color: var(--red); }
.quiz-option.selected { border-color: var(--red); background: #fff1f4; font-weight: 700; }
.quiz-option .idx { width: 26px; height: 26px; border-radius: 50%; background: #ffe9ee; color: var(--red-deep); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; flex: none; }
.quiz-option.selected .idx { background: var(--red); color: #fff; }
.quiz-option.correct { border-color: var(--green); background: #eefaf3; }
.quiz-option.wrong { border-color: #d9483f; background: #fff2f1; }
.amount-row { display: flex; gap: 10px; align-items: center; margin-top: 12px; }
.amount-row .input { flex: 1; }
.countdown { text-align: center; color: var(--ink-soft); font-size: 13px; margin-top: 6px; }
.status-pulse { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); margin-right: 6px; animation: pulse 1.1s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.result-banner { border-radius: 14px; padding: 16px; text-align: center; font-weight: 800; font-size: 17px; margin-top: 14px; animation: modalIn .3s ease; }
.result-banner.ok { background: linear-gradient(135deg, #e8f7ee, #d7f2e2); color: #2e8a52; }
.result-banner.err { background: #fff1f2; color: #c94b5f; }

/* 扫码悬浮层 */
.scanner-mask { position: fixed; inset: 0; z-index: 9200; background: rgba(40, 22, 28, .92); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; }
.scanner-mask .frame { width: min(86vw, 320px); border-radius: 18px; overflow: hidden; background: #000; }
.scanner-mask .tip { color: #fff; margin-top: 16px; font-size: 14px; text-align: center; }
.scanner-mask .tip.soft { color: #d8b8c0; font-size: 12.5px; }

/* ============ 股市 ============ */
.index-card { background: linear-gradient(135deg, #fff, #fff4f6); }
.index-value { font-size: 30px; font-weight: 800; font-family: ui-monospace, Consolas, monospace; }
.spark { width: 100%; height: 60px; margin-top: 6px; }
.spark path.line { fill: none; stroke: var(--red); stroke-width: 2; }
.spark path.area { fill: rgba(224, 90, 109, .12); stroke: none; }
.company-item { display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: 1px solid #faf0f2; }
.company-item:last-child { border-bottom: none; }
.company-item .cname { font-weight: 800; font-size: 15px; }
.company-item .own { font-size: 11.5px; color: var(--ink-faint); font-weight: 400; }
.company-item .price-box { text-align: right; flex: none; }
.company-item .price { font-size: 17px; font-weight: 800; font-family: ui-monospace, Consolas, monospace; }
.company-item .chg { font-size: 12px; font-weight: 700; }
.company-item .ops { display: flex; gap: 6px; flex: none; }
/* 公司行里的迷你走势图（位于公司名与买卖按钮之间） */
.company-item .cspark { flex: none; width: 96px; display: flex; align-items: center; justify-content: center; }
.spark-mini { width: 96px; height: 30px; display: block; }
.spark-mini path.line { fill: none; stroke-width: 1.6; }
.spark-mini path.area { stroke: none; }
.spark-mini.up path.line { stroke: #d9483f; }
.spark-mini.up path.area { fill: rgba(217, 72, 63, .12); }
.spark-mini.down path.line { stroke: #3a9e6a; }
.spark-mini.down path.area { fill: rgba(58, 158, 106, .12); }
.spark-mini.flat path.line { stroke: var(--ink-faint); }
.spark-mini.flat path.area { fill: rgba(0, 0, 0, .04); }
.spark.up path.line { stroke: #d9483f; }
.spark.up path.area { fill: rgba(217, 72, 63, .12); }
.spark.down path.line { stroke: #3a9e6a; }
.spark.down path.area { fill: rgba(58, 158, 106, .12); }
/* 走势范围下拉 */
.range-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.range-row label { font-size: 13px; color: var(--ink-faint); flex: none; }
.range-row select { flex: 1; padding: 8px 10px; font-size: 14px; }
@media (max-width: 520px) {
  .company-item { gap: 8px; }
  .company-item .cspark, .spark-mini { width: 62px; }
  .spark-mini { height: 26px; }
}
.holding-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 2px; border-bottom: 1px solid #faf0f2; font-size: 14px; }
.holding-row:last-child { border-bottom: none; }
.debt-line { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; font-weight: 700; }
.debt-line .num { color: var(--red-deep); font-family: ui-monospace, Consolas, monospace; font-size: 17px; }

/* ============ 故事 ============ */
.story-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 4px; border-bottom: 1px solid #faf0f2; cursor: pointer; }
.story-card:last-child { border-bottom: none; }
.story-card .title { font-weight: 800; color: var(--red-deep); }
.story-body { white-space: pre-wrap; font-size: 15px; color: #5f4149; line-height: 1.9; }
.story-img { width: 100%; border-radius: 14px; margin-top: 12px; box-shadow: var(--shadow); }

/* ============ 管理员 ============ */
.admin-subnav { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.admin-subnav .seg { flex: none; padding: 7px 14px; background: #fff; border: 1.5px solid #f6e3e8; }
.admin-subnav .seg.active { background: var(--red); color: #fff; border-color: var(--red); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 12px; }
.stat-card { background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 14px; }
.stat-card .k { color: var(--ink-soft); font-size: 12.5px; }
.stat-card .v { font-size: 24px; font-weight: 800; color: var(--red-deep); font-family: ui-monospace, Consolas, monospace; }
.issue-code-item { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid #faf0f2; }
.issue-code-item:last-child { border-bottom: none; }
.issue-code-item .qr-mini img, .issue-code-item .qr-mini canvas { width: 74px !important; height: 74px !important; border-radius: 8px; }
.issue-code-item .cc { font-family: ui-monospace, Consolas, monospace; font-size: 20px; font-weight: 800; letter-spacing: 3px; color: var(--red-deep); }
.upload-thumb { position: relative; display: inline-block; margin: 6px 8px 0 0; }
.upload-thumb img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; border: 1.5px solid #f4dfe4; }
.upload-thumb .rm { position: absolute; top: -7px; right: -7px; width: 22px; height: 22px; border-radius: 50%; background: #d9534f; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; cursor: pointer; }
.opt-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.opt-row .input { flex: 1; }
.switch { position: relative; width: 46px; height: 26px; border-radius: 999px; background: #e8d7dc; cursor: pointer; transition: background .2s; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.switch.on { background: var(--green); }
.switch.on::after { transform: translateX(20px); }
.log-line { font-size: 12.5px; color: var(--ink-soft); padding: 5px 0; border-bottom: 1px dashed #f6e5e9; }
.log-line b { color: var(--red-deep); }

/* 桌面端微调 */
@media (min-width: 860px) {
  .quick-grid { grid-template-columns: repeat(4, 1fr); }
  .hero { min-height: 240px; }
}
