/* ImmoExpert Pro — b2b 设计系统
   字体: IBM Plex Sans (自托管, 与 2C 报告同源品牌字体)
   唯一强调色: 品牌绿 #15795b (语义色 err/ok/warn 除外)
   圆角制度: 控件 10px / 面板 14px / 徽章 999px — 全站唯一制度
   动效: 仅 CSS 过渡 (150ms), 无循环动画 */

@font-face { font-family: 'IBM Plex Sans'; font-weight: 400; font-display: swap;
  src: url('/static/fonts/ibm-plex-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 500; font-display: swap;
  src: url('/static/fonts/ibm-plex-sans-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 600; font-display: swap;
  src: url('/static/fonts/ibm-plex-sans-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 700; font-display: swap;
  src: url('/static/fonts/ibm-plex-sans-latin-700-normal.woff2') format('woff2'); }

:root {
  --green: #15795b;
  --green-deep: #0e5a44;
  --green-tint: #dcebe4;
  --green-wash: #f2f7f5;
  --ink: #21251f;
  --ink-2: #626759;
  --line: #e4e6de;
  --line-soft: #eceee7;
  --paper: #f8f8f4;
  --panel: #ffffff;
  --err: #b42318; --err-bg: #fdf1f0;
  --ok: #15795b;  --ok-bg: #f2f7f5;
  --warn: #935f10; --warn-bg: #fbf3e4;
  --r-ctl: 10px;
  --r-panel: 14px;
  --ring: 0 0 0 3px rgba(21, 121, 91, .22);
  --shadow-panel: 0 1px 2px rgba(33, 37, 31, .04), 0 4px 16px rgba(33, 37, 31, .05);
}

* { box-sizing: border-box; }
html { height: 100%; }
body {
  margin: 0; min-height: 100dvh;
  font-family: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
  font-size: 14.5px; line-height: 1.55;
  color: var(--ink); background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--green); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--green-deep); }

/* ============ 品牌标记 ============ */
.brandmark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brandmark svg { display: block; border-radius: 8px; }
.brandmark .wordmark { font-size: 16px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
.brandmark .wordmark b { color: var(--green); font-weight: 600; }

/* ============ 应用壳 (登录后) ============ */
.topbar {
  height: 60px; display: flex; align-items: center; gap: 18px;
  padding: 0 28px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.topbar nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.topbar nav a {
  position: relative; color: var(--ink-2); text-decoration: none;
  font-size: 14px; font-weight: 500; padding: 8px 12px; border-radius: var(--r-ctl);
  transition: color .15s, background .15s;
}
.topbar nav a:hover { color: var(--ink); background: var(--line-soft); }
.topbar nav a.active { color: var(--ink); background: var(--line-soft); }
form.inline { display: inline; }
.linklike {
  background: none; border: 0; padding: 8px 12px; border-radius: var(--r-ctl);
  color: var(--ink-2); cursor: pointer; font-size: 14px; font-weight: 500;
  font-family: inherit; transition: color .15s, background .15s;
}
.linklike:hover { color: var(--ink); background: var(--line-soft); }

main { max-width: 720px; margin: 0 auto; padding: 40px 24px 72px; }
main.narrow { max-width: 560px; }
main.wide { max-width: 1240px; }
main.authmain { max-width: none; margin: 0; padding: 0; }

.pagehead { margin: 0 0 28px; }
.pagehead h1 { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -.015em; }
.pagehead p { margin: 6px 0 0; color: var(--ink-2); font-size: 14px; }

/* ============ 认证页 (分屏) ============ */
.auth { display: grid; grid-template-columns: minmax(360px, 44%) 1fr; min-height: 100dvh; }
.auth-brand {
  background: linear-gradient(165deg, #242923 0%, #171b18 100%);
  color: #fff; display: flex; flex-direction: column; justify-content: space-between;
  padding: 44px 48px;
}
.auth-brand-pitch h2::before {
  content: ""; display: block; width: 28px; height: 3px; border-radius: 2px;
  background: var(--green); margin-bottom: 18px;
}
.auth-brand .brandmark .wordmark { color: #fff; }
.auth-brand .brandmark .wordmark b { color: #fff; opacity: .82; }
.auth-brand-pitch h2 {
  margin: 0 0 12px; font-size: clamp(22px, 2.6vw, 30px); font-weight: 600;
  line-height: 1.25; letter-spacing: -.015em; max-width: 15em;
}
.auth-brand-pitch p { margin: 0; font-size: 14.5px; line-height: 1.6; opacity: .78; max-width: 34em; }
.auth-brand-foot { font-size: 12.5px; opacity: .6; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.auth-form > div { width: 100%; max-width: 384px; }
.auth-form h1 { margin: 0 0 6px; font-size: 22px; font-weight: 600; letter-spacing: -.015em; }
.auth-form .lede { margin: 0 0 24px; color: var(--ink-2); font-size: 14px; }

@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { flex-direction: row; align-items: center; justify-content: flex-start;
    padding: 18px 24px; }
  .auth-brand-pitch, .auth-brand-foot { display: none; }
  .auth-form { padding: 36px 20px; align-items: flex-start; }
}

/* ============ 表单 ============ */
.field { margin: 0 0 16px; }
.field label { display: block; margin: 0 0 6px; font-size: 13px; font-weight: 500; color: var(--ink); }
.field .hint { display: block; margin-top: 5px; font-size: 12.5px; color: var(--ink-2); }
input[type=email], input[type=password], input[type=text], input[type=number] {
  width: 100%; padding: 10px 12px; font: inherit; font-size: 14px; color: var(--ink);
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-ctl);
  transition: border-color .15s, box-shadow .15s;
}
input:focus-visible { outline: none; border-color: var(--green); box-shadow: var(--ring); }
input::placeholder { color: #a4a89c; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }

label.checkbox {
  display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--ink);
  margin: 2px 0 0; cursor: pointer;
}
label.checkbox input { width: 16px; height: 16px; accent-color: var(--green); }

input[type=file] { width: 100%; font-size: 13px; color: var(--ink-2); padding: 4px 0; }
input[type=file]::file-selector-button {
  font: inherit; font-size: 13px; font-weight: 500; color: var(--ink);
  background: var(--line-soft); border: 1px solid var(--line);
  border-radius: var(--r-ctl); padding: 7px 14px; margin-right: 12px; cursor: pointer;
}

.btn-primary {
  width: 100%; margin-top: 22px; padding: 12px; border: 0; border-radius: var(--r-ctl);
  background: var(--green); color: #fff; font: inherit; font-weight: 600; font-size: 14.5px;
  cursor: pointer; transition: background .15s, transform .06s;
}
.btn-primary:hover { background: var(--green-deep); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:focus-visible { outline: none; box-shadow: var(--ring); }

.btn-quiet {
  font: inherit; font-size: 12.5px; font-weight: 500; color: var(--ink);
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-ctl);
  padding: 6px 11px; cursor: pointer; transition: border-color .15s, background .15s;
}
.btn-quiet:hover { border-color: var(--green); color: var(--green-deep); background: var(--green-wash); }
.btn-quiet:active { transform: translateY(1px); }

/* ============ 提示条 ============ */
.error, .success {
  padding: 11px 14px; border-radius: var(--r-ctl); margin: 0 0 18px; font-size: 13.5px;
  border: 1px solid transparent;
}
.error { background: var(--err-bg); color: var(--err); border-color: #f3d5d2; }
.success { background: var(--ok-bg); color: var(--green-deep); border-color: var(--green-tint); }
.muted { color: var(--ink-2); font-size: 13.5px; margin: 14px 0 0; }

/* ============ 面板 ============ */
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-panel);
  padding: 24px 26px; box-shadow: var(--shadow-panel);
}
.panel + .panel { margin-top: 18px; }
.panel h2 { margin: 0 0 4px; font-size: 15.5px; font-weight: 600; }
.panel.soft { background: #f4f5f0; border-color: var(--line); box-shadow: none; }

/* 仪表盘状态 */
.status-card { display: flex; align-items: flex-start; gap: 18px; }
.status-main { flex: 1; }
.status-label { margin: 0 0 2px; font-size: 13px; color: var(--ink-2); }
.status-value { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -.015em; color: var(--ink); }
.status-meta { margin: 8px 0 0; font-size: 13.5px; color: var(--ink-2); }
.trial-meter { height: 5px; background: var(--line-soft); border-radius: 999px; margin-top: 14px; overflow: hidden; }
.trial-meter i { display: block; height: 100%; background: var(--green); border-radius: 999px; }

.feature-placeholder h2 { margin: 0 0 4px; font-size: 15.5px; font-weight: 600; }
.feature-placeholder p { margin: 0; }

/* ============ 白牌设置 ============ */
.formsec { margin: 0 0 8px; padding: 22px 0 8px; border-top: 1px solid var(--line-soft); }
.formsec:first-of-type { border-top: 0; padding-top: 4px; }
.formsec > h2 { margin: 0 0 14px; font-size: 15px; font-weight: 600; }
.logo-preview {
  width: 96px; height: 96px; border: 1px solid var(--line); border-radius: var(--r-ctl);
  background: var(--panel); display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px; overflow: hidden;
}
.logo-preview img { max-width: 84px; max-height: 84px; }
.color-field { display: flex; align-items: center; gap: 10px; }
.color-field input { flex: 1; }
.swatch {
  width: 38px; height: 38px; flex: none; border-radius: var(--r-ctl);
  border: 1px solid var(--line);
}

/* ============ Admin ============ */
.adminhead { display: flex; align-items: center; justify-content: space-between; margin: 0 0 18px; }
.adminhead h1 { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -.015em; }

.filters { display: inline-flex; gap: 4px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px; margin: 0 0 18px; }
.filters a {
  padding: 6px 14px; border-radius: 999px; text-decoration: none; font-size: 13px;
  font-weight: 500; color: var(--ink-2); transition: color .15s, background .15s;
}
.filters a:hover { color: var(--ink); }
.filters a.current { background: var(--ink); color: #fff; }

.admin-table-wrap { background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-panel); box-shadow: var(--shadow-panel); overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.admin-table th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-2);
  padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.admin-table td {
  padding: 12px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: top;
  font-variant-numeric: tabular-nums;
}
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table tbody tr:hover { background: #f5f6f1; }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge.trial     { background: var(--line-soft); color: var(--ink-2); }
.badge.active    { background: var(--green-wash); color: var(--green-deep); border: 1px solid var(--green-tint); }
.badge.suspended { background: var(--warn-bg); color: var(--warn); border: 1px solid #eeddb9; }
.badge.cancelled { background: var(--line-soft); color: var(--ink-2); }

.admin-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.admin-actions input[type=number], .admin-actions input[type=text] {
  padding: 5px 8px; font-size: 12.5px; border-radius: 8px; width: auto;
}
.admin-actions input[type=number] { width: 4.2em; }
.admin-actions input[type=text] { width: 11em; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
