/* Colours, type and shapes follow the club main site (www.gptclub.ai theme "gptclub", --gc-* tokens). */
:root {
  --gc-paper: #f5ecd7;
  --gc-paper-soft: #fbf6ea;
  --gc-jade: #1f6b45;
  --gc-jade-soft: #2f875a;
  --gc-jade-faint: rgba(31, 107, 69, 0.1);
  --gc-ink: #3b3124;
  --gc-ink-soft: #6f624e;
  --gc-gold: #9f7d3a;
  --gc-line: rgba(59, 49, 36, 0.12);
  --gc-card: linear-gradient(140deg, rgba(255, 255, 255, 0.86) 0%, rgba(255, 251, 243, 0.9) 54%, rgba(246, 238, 219, 0.96) 100%);
  --gc-shadow-sm: 0 14px 36px rgba(63, 48, 22, 0.08);
  --gc-header: rgba(250, 244, 229, 0.92);
  --gc-bg:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.38), transparent 28%),
    radial-gradient(circle at bottom right, rgba(31, 107, 69, 0.06), transparent 24%),
    linear-gradient(180deg, #f5ead1 0%, #efe2bf 100%);
  --gc-dots: rgba(59, 49, 36, 0.05);
  --gc-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --gc-sans: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --gc-radius-lg: 26px;
  --gc-radius-md: 18px;
  --gc-radius-sm: 12px;
}

/* ── base ─────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background-color: #efe2bf; }
body {
  margin: 0; min-height: 100vh; color: var(--gc-ink); background: var(--gc-bg);
  font: 15px/1.6 var(--gc-sans); -webkit-font-smoothing: antialiased;
}
body::before {  /* the main site's fine dot texture */
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .3;
  background-image: radial-gradient(var(--gc-dots) 0.7px, transparent 0.7px); background-size: 10px 10px;
}
a { color: var(--gc-jade); text-decoration: none; }
a:hover { color: var(--gc-jade-soft); }
h1, h2 { font-family: var(--gc-serif); font-weight: 700; color: var(--gc-ink); }
h1 { font-size: 22px; margin: 0 0 18px; }
h2 { font-size: 17px; margin: 22px 0 12px; }
h2:first-child { margin-top: 0; }
:focus-visible { outline: 2px solid var(--gc-jade); outline-offset: 2px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset:disabled { opacity: .45; }
.muted { color: var(--gc-ink-soft); }
.small { font-size: 12.5px; }
.error { color: #b3261e; }
.msg { min-height: 1.5em; margin: 8px 0 0; }

/* ── header (same look as the main site's .gc-header) ─────────────── */
.nav {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 24px; overflow-x: auto;
  min-height: 72px; padding: 0 28px; background: var(--gc-header);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--gc-line); box-shadow: 0 10px 26px rgba(67, 51, 23, .06);
}
.nav .brand {
  display: inline-flex; align-items: center; gap: 10px; color: var(--gc-ink); white-space: nowrap;
  font-family: var(--gc-serif); font-size: 18px; font-weight: 600; letter-spacing: .02em;
}
.nav .brand img { width: 40px; height: 40px; filter: drop-shadow(0 4px 10px rgba(31, 107, 69, .08)); }
.nav .brand:hover { color: var(--gc-jade); }
.nav nav { display: flex; gap: 6px; flex: 1; min-width: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.nav nav::-webkit-scrollbar { display: none; }
.nav nav a {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: 999px;
  color: var(--gc-ink); font-size: 16px; white-space: nowrap; border: 1px solid transparent;
}
.nav nav a:hover { color: var(--gc-jade); background: var(--gc-jade-faint); }
.nav nav a.on { color: var(--gc-jade); background: var(--gc-jade-faint); border-color: rgba(31, 107, 69, .18); font-weight: 600; }
.nav .ic { width: 19px; height: 19px; flex: none; }
.nav .logout { display: flex; gap: 12px; align-items: center; color: var(--gc-ink-soft); font-size: 15px; }
.nav .who, .nav .logout button { display: inline-flex; align-items: center; gap: 6px; }

/* ── layout & cards ───────────────────────────────────────────────── */
main { padding: 26px 28px; }
main.center { display: flex; justify-content: center; padding-top: 12vh; }
main.split { display: grid; grid-template-columns: minmax(380px, 540px) 1fr; gap: 22px; align-items: start; }
.card {
  background: var(--gc-card); border: 1px solid var(--gc-line); border-radius: var(--gc-radius-lg);
  box-shadow: var(--gc-shadow-sm); padding: 22px 26px;
}
.card.wide { max-width: 1180px; }

/* ── form controls ────────────────────────────────────────────────── */
label { display: block; margin-bottom: 12px; color: var(--gc-ink-soft); font-size: 14px; }
input, select, textarea {
  display: block; width: 100%; margin-top: 5px; padding: 9px 12px; font: inherit; color: var(--gc-ink);
  background: rgba(255, 252, 245, .8); border: 1px solid rgba(59, 49, 36, .16); border-radius: var(--gc-radius-sm);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gc-jade); box-shadow: 0 0 0 3px var(--gc-jade-faint); }
textarea { resize: vertical; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.req { color: #b3261e; margin-left: 2px; }
label.check { display: flex; gap: 8px; align-items: center; color: var(--gc-ink); }
label.check input { width: auto; margin: 0; accent-color: var(--gc-jade); }
h2.sub label.check { font: inherit; }

/* buttons: secondary pill by default, jade gradient for .primary (main site .gc-btn) */
button {
  font: inherit; font-weight: 600; padding: 9px 20px; border-radius: 999px; cursor: pointer; color: var(--gc-ink);
  background: linear-gradient(180deg, rgba(255, 255, 255, .62) 0%, rgba(255, 255, 255, .22) 100%), rgba(255, 250, 241, .5);
  border: 1px solid rgba(59, 49, 36, .14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 8px 18px rgba(77, 59, 25, .07);
  transition: transform .15s ease, box-shadow .15s ease;
}
button:hover:not(:disabled) { transform: translateY(-1px); }
button.primary {
  color: #fffaf0; border-color: rgba(255, 255, 255, .2);
  background: linear-gradient(180deg, rgba(255, 255, 255, .2) 0%, rgba(255, 255, 255, .04) 100%), linear-gradient(135deg, #1f6b45 0%, #2f875a 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 12px 24px rgba(31, 107, 69, .2);
}
button:disabled { opacity: .45; cursor: not-allowed; }
button.link { padding: 0; border: 0; background: none; box-shadow: none; color: var(--gc-jade); font-weight: 500; }
button.link.muted { color: var(--gc-ink-soft); }
button.link.danger { color: #a33b2b; }
button.link:hover { transform: none; color: var(--gc-jade-soft); }

/* ── login ────────────────────────────────────────────────────────── */
.login { width: 380px; text-align: left; }
.login .logo { display: block; width: 64px; height: 64px; margin: 0 auto 10px; }
.login h1 { text-align: center; }
.login button { width: 100%; margin-top: 8px; padding: 11px; }

/* ── invoice page ─────────────────────────────────────────────────── */
.drop { margin: 10px 0; padding: 14px; border: 1px dashed rgba(59, 49, 36, .25); border-radius: var(--gc-radius-md); color: var(--gc-ink-soft); text-align: center; background: rgba(255, 252, 245, .45); }
.drop.over { border-color: var(--gc-jade); background: var(--gc-jade-faint); }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; justify-content: center; }
.thumb { position: relative; }
.thumb img { height: 64px; border: 1px solid var(--gc-line); border-radius: 8px; }
.thumb button { position: absolute; top: -7px; right: -6px; width: 20px; height: 20px; padding: 0; line-height: 18px; background: #fffaf0; border-radius: 50%; }
.items-edit { width: 100%; border-collapse: collapse; margin-bottom: 6px; }
.items-edit th { text-align: left; font-weight: normal; color: var(--gc-ink-soft); padding-bottom: 2px; font-size: 14px; }
.items-edit td { padding: 2px 4px 2px 0; }
.items-edit .amt { width: 130px; }
.items-edit input { margin: 0; }
.total { text-align: right; }
.actions { display: flex; gap: 10px; }
.done { margin-top: 12px; padding: 12px 14px; background: var(--gc-jade-faint); border: 1px solid rgba(31, 107, 69, .2); border-radius: var(--gc-radius-md); }
.preview-col { position: sticky; top: 96px; height: calc(100vh - 124px); padding: 0; overflow: hidden; }
.preview-col iframe { width: 100%; height: 100%; border: 0; display: none; }
.preview-col iframe.on { display: block; }
.preview-col .muted { padding: 24px; }

/* ── lists, history, admin ────────────────────────────────────────── */
table.list { width: 100%; border-collapse: collapse; margin-top: 14px; }
table.list th, table.list td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--gc-line); }
table.list th { color: var(--gc-ink-soft); font-weight: 600; font-size: 14px; }
table.list .amt { text-align: right; white-space: nowrap; }
td.ops { white-space: nowrap; }
td.ops form { display: inline-block; margin: 0 12px 0 0; }
table.list td { white-space: nowrap; }
table.list td.cust { white-space: normal; min-width: 180px; }
table.list tr.off td { color: #a69a83; }
table.list tr.voided td { color: #a69a83; }
table.list tr.voided td.amt { text-decoration: line-through; }
form.inline { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
form.inline input, form.inline select { width: auto; margin: 0; }
.secret { margin: 12px 0; padding: 12px 14px; background: rgba(159, 125, 58, .1); border: 1px solid rgba(159, 125, 58, .3); border-radius: var(--gc-radius-md); }
.secret code { font-size: 15px; background: #fffaf0; padding: 2px 8px; border-radius: 6px; user-select: all; }
.list-head { display: flex; justify-content: space-between; align-items: center; }
.list-head h2 { margin: 0; }
.stats { display: grid; grid-template-columns: 1fr 1fr 0.7fr; gap: 14px; margin: 16px 0 8px; }
.stat { border: 1px solid var(--gc-line); border-radius: var(--gc-radius-md); padding: 12px 16px; }
.stat.pending { background: rgba(159, 125, 58, .08); }
.stat.confirmed { background: var(--gc-jade-faint); }
.stat.void { background: rgba(59, 49, 36, .04); color: var(--gc-ink-soft); }
.stat-title { color: var(--gc-ink-soft); }
.stat-count { font-family: var(--gc-serif); font-size: 24px; font-weight: 700; margin: 2px 0; }
.tabs { display: flex; gap: 6px; margin-top: 14px; }
.tabs a { padding: 6px 16px; border-radius: 999px; color: var(--gc-ink); border: 1px solid var(--gc-line); background: rgba(255, 252, 245, .5); }
.tabs a:hover { color: var(--gc-jade); }
.tabs a.on { color: var(--gc-jade); background: var(--gc-jade-faint); border-color: rgba(31, 107, 69, .2); font-weight: 600; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; white-space: nowrap; }
.badge.wait { background: rgba(159, 125, 58, .14); color: #7a5a1f; }
.badge.ok { background: var(--gc-jade-faint); color: var(--gc-jade); }
.badge.void { background: rgba(59, 49, 36, .08); color: var(--gc-ink-soft); }

@media (max-width: 1180px) {
  .nav { flex-wrap: wrap; gap: 8px 14px; padding: 8px 16px; min-height: auto; }
  .nav nav { flex-basis: 100%; overflow: visible; flex-wrap: wrap; }
  .nav .right { margin-left: 0; }
  .nav .right .who { max-width: none; }
}
@media (max-width: 900px) {
  main.split { grid-template-columns: 1fr; }
  .preview-col { position: static; height: 80vh; }
  .nav { flex-wrap: wrap; padding: 10px 16px; gap: 10px; }
}


/* ── team 系统补充组件（继承上面 gc-* 令牌） ─────────────────────── */
.nav .right { display: flex; gap: 10px; align-items: center; margin-left: auto; flex: none; }
.nav .right .who { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 34vw; }
.nav .right a { color: var(--gc-ink-soft); font-size: 14px; white-space: nowrap; }
.nav .right a:hover { color: var(--gc-jade); }
.nav .who { color: var(--gc-ink-soft); font-size: 14px; white-space: nowrap; }
main.wide { max-width: 1500px; margin: 0 auto; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 11px; border-radius: 999px;
        background: rgba(255, 252, 245, .6); border: 1px solid var(--gc-line); font-size: 12.5px; color: var(--gc-ink); }
.chip b { font-weight: 700; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.filters input[type=search] { flex: 1; min-width: 240px; margin: 0; }
.filters select, .filters input[type=text] { width: auto; margin: 0; }
#legend .chip { cursor: pointer; }
/* 宽表：列宽由 JS 控制（可拖动并保存），超出容器横向滚动 */
.table-wrap { overflow-x: auto; overflow-y: visible; padding-bottom: 4px; }
.table-wrap::-webkit-scrollbar { height: 10px; }
.table-wrap::-webkit-scrollbar-thumb { background: var(--gc-line); border-radius: 6px; }
table.grid { border-collapse: separate; border-spacing: 0; table-layout: fixed; min-width: 100%; }
table.grid th, table.grid td { padding: 9px 10px; border-bottom: 1px solid var(--gc-line); text-align: left;
        vertical-align: top; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; position: relative; }
table.grid th { white-space: nowrap; }
table.grid td .mtag { display: inline-block; width: 5px; height: 5px; margin-left: 2px; border-radius: 50%;
        background: var(--gc-gold, #9f7d3a); vertical-align: super; }
table.grid th .rsz { position: absolute; top: 0; right: -3px; width: 8px; height: 100%; cursor: col-resize; z-index: 2; }
table.grid th .rsz:hover, table.grid th.resizing .rsz { background: rgba(31, 107, 69, .25); }
table.grid th { color: var(--gc-ink-soft); font-weight: 600; font-size: 12.5px; cursor: pointer; }
table.grid tbody tr { cursor: pointer; }
table.grid tbody tr:hover td { background: rgba(31, 107, 69, .05); }
table.grid td.chan { white-space: normal; }
table.grid td.col-cust, table.grid td.col-state, table.grid td.col-org, table.grid td.col-net { white-space: normal; }
table.grid td.mono, table.grid td.col-cust, table.grid td.col-state { white-space: normal; word-break: break-word; overflow-wrap: anywhere; }
table.grid td.col-net .muted { word-break: break-all; }
table.grid td.col-org { word-break: break-all; }
table.grid td.chan .nm { display: inline-block; max-width: 200px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
table.grid td.col-state { white-space: normal; }
table.grid td.col-org { white-space: normal; word-break: break-all; font-size: 12.5px; }
table.grid td.col-n { overflow: visible; }
tr.row-warn td { background: rgba(159, 125, 58, .12); }
tr.row-danger td { background: rgba(163, 59, 43, .12); }
tr.row-warn:hover td { background: rgba(159, 125, 58, .2); }
tr.row-danger:hover td { background: rgba(163, 59, 43, .2); }
tr.row-danger td:first-child { box-shadow: inset 3px 0 0 #a33b2b; }
tr.row-warn td:first-child { box-shadow: inset 3px 0 0 var(--gc-gold); }
.st-ok { color: var(--gc-jade); } .st-warn { color: #8a6a22; } .st-err { color: #a33b2b; } .st-mute { color: var(--gc-ink-soft); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.tag { display: inline-block; padding: 1px 7px; border-radius: 6px; font-size: 11px; border: 1px solid var(--gc-line); color: var(--gc-ink-soft); }
.srv { display: inline-block; padding: 0 6px; border-radius: 6px; font-size: 10.5px; line-height: 16px; border: 1px solid var(--gc-line); color: var(--gc-ink-soft); }
.srv.ent { color: #7a5a1f; border-color: #c9a45a; background: linear-gradient(180deg, #f6e3ae, #e3c17a); font-weight: 700; }
.fix-badge { display: inline-block; margin-left: 5px; padding: 0 5px; border-radius: 6px; font-size: 10.5px; line-height: 16px; font-weight: 700; border: 1px solid; }
.fix-badge.b2 { color: #8a6a22; border-color: #c9a45a; background: rgba(159, 125, 58, .14); }
.fix-badge.b3 { color: #a33b2b; border-color: #c07a6b; background: rgba(163, 59, 43, .12); }
.ncell { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
#drawer { position: fixed; inset: 0; background: rgba(40, 32, 20, .38); display: none; z-index: 40; }
#drawer.open { display: block; }
#panel { position: absolute; right: 0; top: 0; bottom: 0; width: min(720px, 100%); background: var(--gc-bg);
         border-left: 1px solid var(--gc-line); overflow: auto; padding: 20px; }
#panel section.card { padding: 16px 18px; margin-top: 12px; border-radius: var(--gc-radius-md); }
#panel h3 { font-size: 12.5px; color: var(--gc-ink-soft); font-weight: 600; margin: 0 0 10px; }
#panel dl { display: grid; grid-template-columns: 96px 1fr; gap: 6px 10px; margin: 0; }
#panel dt { color: var(--gc-ink-soft); font-size: 12.5px; }
#panel dd { margin: 0; word-break: break-all; }
.tl { border-left: 2px solid var(--gc-line); margin-left: 6px; padding-left: 14px; }
.tl .item { position: relative; padding-bottom: 14px; }
.tl .item:last-child { padding-bottom: 0; }
.tl .item::before { content: ""; position: absolute; left: -20px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--gc-jade); }
.tl .item.old::before { background: var(--gc-line); }
.copy, .reveal { font-size: 11px; border: 0; background: transparent; color: var(--gc-jade); padding: 0 4px; cursor: pointer; box-shadow: none; }
.copy:hover, .reveal:hover { transform: none; color: var(--gc-jade-soft); }
.reveal { color: var(--gc-ink-soft); text-decoration: underline; }
.secret { font-family: ui-monospace, Menlo, monospace; }
@media (max-width: 700px) { .filters input[type=search] { min-width: 0; width: 100%; } }
