:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-soft: #f0f3f3;
  --ink: #152b45;
  --ink-2: #3f5065;
  --muted: #6c7a8b;
  --line: #dfe4e7;
  --line-strong: #cbd4d9;
  --primary: #137f79;
  --primary-dark: #0d6561;
  --primary-soft: #e6f3f1;
  --navy-soft: #eaf0f5;
  --danger: #b44343;
  --danger-soft: #fff0ee;
  --warning: #9a681b;
  --warning-soft: #fff6e6;
  --success: #28745b;
  --success-soft: #e9f5ef;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 12px 36px rgba(21, 43, 69, .07);
  --shadow-sm: 0 4px 16px rgba(21, 43, 69, .06);
  --container: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
body.modal-open { overflow: hidden; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
svg { display: block; }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3, h4 { line-height: 1.3; letter-spacing: -.02em; }
p { color: var(--ink-2); }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(19, 127, 121, .2);
  outline-offset: 2px;
}
::selection { color: var(--ink); background: #cce8e4; }

.container { width: min(var(--container), calc(100% - 48px)); margin: 0 auto; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.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; }

.site-header {
  position: sticky; top: 0; z-index: 30;
  border-bottom: 1px solid rgba(203, 212, 217, .75);
  background: rgba(246, 245, 241, .96);
  backdrop-filter: blur(14px);
}
.header-inner { height: 74px; display: flex; align-items: center; gap: 30px; }
.brand { flex: 0 0 auto; display: flex; align-items: center; }
.brand img { width: 153px; height: 42px; }
.main-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-link {
  padding: 8px 12px; border: 0; border-radius: 8px; background: transparent;
  color: var(--ink-2); font-size: 14px; cursor: pointer; white-space: nowrap;
}
.nav-link:hover, .nav-link.active { color: var(--primary-dark); background: var(--primary-soft); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.user-chip { display: flex; align-items: center; gap: 8px; max-width: 180px; }
.user-avatar {
  display: grid; place-items: center; flex: 0 0 auto; width: 32px; height: 32px;
  border-radius: 50%; color: var(--primary-dark); background: var(--primary-soft); font-weight: 700;
}
.user-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.mobile-menu-button { display: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 9px 18px; border: 1px solid transparent; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 14px; line-height: 1.4; cursor: pointer;
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { color: #fff; background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-secondary { color: var(--ink); background: var(--surface); border-color: var(--line-strong); }
.btn-secondary:hover { color: var(--primary-dark); border-color: var(--primary); }
.btn-ghost { color: var(--ink-2); background: transparent; border-color: transparent; }
.btn-ghost:hover { color: var(--primary-dark); background: var(--primary-soft); }
.btn-danger { color: #fff; background: var(--danger); border-color: var(--danger); }
.btn-danger-ghost { color: var(--danger); background: var(--surface); border-color: #e7c4c1; }
.btn-sm { min-height: 34px; padding: 6px 11px; font-size: 13px; }
.btn-lg { min-height: 50px; padding: 13px 24px; font-size: 16px; }
.btn-block { width: 100%; }
.btn .icon { width: 17px; height: 17px; }
.icon { width: 20px; height: 20px; flex: 0 0 auto; }
.icon-button {
  display: inline-grid; place-items: center; width: 38px; height: 38px; padding: 0;
  border: 0; border-radius: 9px; color: var(--muted); background: transparent; cursor: pointer;
}
.icon-button:hover { color: var(--ink); background: var(--surface-soft); }

.hero { padding: 74px 0 66px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.04fr .96fr; gap: 76px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 20px;
  color: var(--primary-dark); font-size: 13px; font-weight: 700; letter-spacing: .12em;
}
.eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--primary); }
.hero h1 { margin-bottom: 22px; font-size: clamp(40px, 5vw, 62px); font-weight: 750; letter-spacing: -.045em; }
.hero h1 span { display: block; margin-top: 10px; color: var(--primary); font-size: .56em; letter-spacing: -.02em; }
.hero-lead { max-width: 560px; margin-bottom: 30px; color: var(--ink-2); font-size: 18px; line-height: 1.85; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 28px; }
.hero-notes { display: flex; flex-wrap: wrap; gap: 18px; color: var(--muted); font-size: 13px; }
.hero-note { display: flex; align-items: center; gap: 6px; }
.hero-note .icon { width: 16px; height: 16px; color: var(--primary); }

.report-preview { position: relative; }
.report-preview::before {
  content: ""; position: absolute; inset: 34px -18px -18px 38px; z-index: -1;
  border: 1px solid var(--line); border-radius: 20px; background: #ecefeb;
}
.preview-card { padding: 26px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.preview-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.preview-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.preview-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; color: #fff; background: var(--ink); }
.preview-mark .icon { width: 18px; height: 18px; }
.preview-score { display: grid; grid-template-columns: 112px 1fr; gap: 24px; align-items: center; padding: 20px; border-radius: 12px; background: var(--navy-soft); }
.score-ring {
  display: grid; place-items: center; width: 98px; height: 98px; border: 8px solid #c9d9df;
  border-top-color: var(--primary); border-right-color: var(--primary); border-radius: 50%;
}
.score-ring strong { font-size: 27px; line-height: 1; }
.score-ring small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; text-align: center; }
.preview-score h3 { margin-bottom: 7px; font-size: 16px; }
.preview-score p { margin: 0; font-size: 12px; }
.preview-lines { margin-top: 24px; }
.preview-line { display: grid; grid-template-columns: 52px 1fr; gap: 12px; align-items: start; margin-top: 14px; }
.preview-line:first-child { margin-top: 0; }
.preview-label { padding: 3px 5px; border-radius: 5px; font-size: 10px; text-align: center; }
.preview-text-line { height: 7px; margin-top: 3px; border-radius: 4px; background: #e5e9eb; box-shadow: 0 13px 0 #edf0f1, 0 26px 0 #edf0f1; }
.preview-line.short .preview-text-line { width: 82%; }
.preview-footer { display: flex; justify-content: space-between; margin-top: 34px; padding-top: 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }

.trust-strip { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.45); }
.trust-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.trust-item { padding: 22px 24px; border-left: 1px solid var(--line); text-align: center; }
.trust-item:first-child { border-left: 0; }
.trust-item strong { display: block; margin-bottom: 2px; font-size: 18px; }
.trust-item span { color: var(--muted); font-size: 12px; }
.section { padding: 82px 0; }
.section-alt { background: #eef1ef; }
.section-header { max-width: 650px; margin-bottom: 38px; }
.section-header.center { margin-right: auto; margin-left: auto; text-align: center; }
.section-kicker { margin-bottom: 9px; color: var(--primary); font-size: 13px; font-weight: 700; letter-spacing: .12em; }
.section-title { margin-bottom: 14px; font-size: clamp(28px, 3.2vw, 38px); }
.section-desc { margin: 0; color: var(--muted); font-size: 16px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature-card { padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.feature-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 22px; border-radius: 11px; color: var(--primary-dark); background: var(--primary-soft); }
.feature-card h3 { margin-bottom: 10px; font-size: 19px; }
.feature-card p { margin-bottom: 0; color: var(--muted); font-size: 14px; }
.feature-list { display: grid; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; color: var(--ink-2); font-size: 13px; }
.feature-list li { display: flex; gap: 7px; align-items: center; }
.feature-list .icon { width: 15px; height: 15px; color: var(--primary); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 44px; counter-reset: steps; }
.step { position: relative; padding-top: 4px; }
.step:not(:last-child)::after { content: ""; position: absolute; top: 26px; left: 72px; right: -24px; border-top: 1px dashed #b8c8c9; }
.step-number { display: grid; place-items: center; width: 50px; height: 50px; margin-bottom: 20px; border: 1px solid #bfd6d3; border-radius: 50%; color: var(--primary-dark); background: var(--surface); font-size: 17px; font-weight: 700; }
.step h3 { margin-bottom: 9px; font-size: 19px; }
.step p { margin: 0; color: var(--muted); font-size: 14px; }

.pricing-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; max-width: 920px; margin: 0 auto; }
.price-card { position: relative; padding: 32px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.price-card.featured { border: 2px solid var(--primary); box-shadow: var(--shadow-sm); }
.price-badge { position: absolute; top: 20px; right: 20px; padding: 4px 10px; border-radius: 20px; color: var(--primary-dark); background: var(--primary-soft); font-size: 12px; font-weight: 700; }
.price-card h3 { margin-bottom: 8px; font-size: 21px; }
.price { margin: 22px 0 4px; font-size: 42px; font-weight: 750; letter-spacing: -.04em; }
.price small { color: var(--muted); font-size: 14px; font-weight: 400; letter-spacing: 0; }
.price-desc { min-height: 48px; color: var(--muted); font-size: 14px; }
.price-features { display: grid; gap: 12px; margin: 24px 0 28px; padding: 22px 0 0; border-top: 1px solid var(--line); list-style: none; }
.price-features li { display: flex; align-items: flex-start; gap: 9px; color: var(--ink-2); font-size: 14px; }
.price-features .icon { width: 17px; height: 17px; margin-top: 4px; color: var(--primary); }
.batch-note { max-width: 920px; margin: 20px auto 0; padding: 17px 22px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.6); text-align: center; }
.batch-note p { margin: 0; font-size: 14px; }

.faq-list { max-width: 850px; margin: 0 auto; border-top: 1px solid var(--line-strong); }
.faq-item { border-bottom: 1px solid var(--line-strong); }
.faq-item summary { position: relative; padding: 22px 44px 22px 0; font-weight: 650; cursor: pointer; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; top: 18px; right: 8px; color: var(--primary); font-size: 25px; font-weight: 400; }
.faq-item[open] summary::after { content: "−"; }
.faq-item p { margin: -4px 0 22px; padding-right: 40px; color: var(--muted); font-size: 14px; }
.support-card { display: grid; grid-template-columns: 1fr 220px; gap: 50px; align-items: center; padding: 42px; border-radius: 18px; color: #fff; background: var(--ink); }
.support-card h2 { margin-bottom: 12px; font-size: 29px; }
.support-card p { color: #c6d1dc; }
.support-card .section-kicker { color: #7fd0c7; }
.support-contact { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.support-contact .btn-secondary { color: #fff; border-color: #5b6c7e; background: transparent; }
.support-qr { padding: 14px; border-radius: 12px; background: #fff; text-align: center; }
.support-qr img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
.support-qr span { display: block; margin-top: 8px; color: var(--ink-2); font-size: 12px; }
.qr-fallback { display: grid; place-items: center; aspect-ratio: 1; padding: 14px; color: var(--muted); background: var(--surface-soft); font-size: 12px; text-align: center; }

.site-footer { border-top: 1px solid var(--line); background: #eef0ed; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 28px; padding-bottom: 28px; }
.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer-brand img { width: 124px; }
.footer-brand p { margin: 0; color: var(--muted); font-size: 12px; }
.footer-meta { color: var(--muted); font-size: 12px; text-align: right; }
.footer-meta p { margin: 0; color: inherit; }

.app-main { min-height: calc(100vh - 200px); }
.app-page { padding: 42px 0 64px; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-heading h1 { margin-bottom: 7px; font-size: 30px; }
.page-heading p { margin: 0; color: var(--muted); }
.page-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.breadcrumbs { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; color: var(--muted); font-size: 13px; }
.breadcrumbs a:hover { color: var(--primary); }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 2px 8px rgba(21,43,69,.025); }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.panel-header h2, .panel-header h3 { margin: 0; font-size: 17px; }
.panel-body { padding: 24px; }
.panel-footer { padding: 16px 24px; border-top: 1px solid var(--line); background: #fafbf9; border-radius: 0 0 var(--radius) var(--radius); }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 22px; align-items: start; }
.editor-panel .panel-body { padding: 0; }
.editor-textarea {
  display: block; width: 100%; min-height: 410px; padding: 24px; resize: vertical;
  border: 0; border-radius: var(--radius); outline: none; color: var(--ink); background: transparent; line-height: 1.9;
}
.editor-textarea::placeholder { color: #98a4af; }
.editor-textarea:focus { box-shadow: inset 0 0 0 2px rgba(19,127,121,.25); }
.editor-meta { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.char-count { color: var(--muted); font-size: 13px; white-space: nowrap; }
.char-count.invalid { color: var(--danger); font-weight: 600; }
.editor-actions { display: flex; gap: 10px; }
.quota-card { padding: 24px; }
.quota-card h3 { margin-bottom: 16px; font-size: 16px; }
.quota-number { display: flex; align-items: baseline; gap: 6px; margin-bottom: 8px; }
.quota-number strong { color: var(--primary-dark); font-size: 34px; line-height: 1.2; }
.quota-number span { color: var(--muted); font-size: 13px; }
.quota-divider { height: 1px; margin: 20px 0; background: var(--line); }
.quota-list { display: grid; gap: 12px; margin: 0; }
.quota-row { display: flex; justify-content: space-between; gap: 16px; font-size: 13px; }
.quota-row dt { color: var(--muted); }
.quota-row dd { margin: 0; font-weight: 600; text-align: right; }
.tip-card { margin-top: 18px; padding: 20px; border: 1px solid #d6e6e3; border-radius: var(--radius); background: var(--primary-soft); }
.tip-card h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; color: var(--primary-dark); font-size: 14px; }
.tip-card p { margin: 0; color: #426964; font-size: 12px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.stat-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; color: var(--muted); font-size: 13px; }
.stat-label .icon { color: var(--primary); }
.stat-value { font-size: 28px; font-weight: 700; line-height: 1.25; }
.stat-note { margin-top: 5px; color: var(--muted); font-size: 12px; }
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { padding: 13px 18px; color: var(--muted); background: #f7f8f6; font-weight: 600; text-align: left; white-space: nowrap; }
.data-table td { padding: 16px 18px; border-top: 1px solid var(--line); vertical-align: middle; }
.data-table tbody tr:hover { background: #fbfcfa; }
.data-table .title-cell { min-width: 220px; max-width: 360px; }
.table-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-weight: 600; }
.table-subtitle { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.table-actions { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.mobile-records { display: none; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 20px; color: var(--ink-2); background: var(--surface-soft); font-size: 11px; font-weight: 650; white-space: nowrap; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-success { color: var(--success); background: var(--success-soft); }
.badge-warning { color: var(--warning); background: var(--warning-soft); }
.badge-danger { color: var(--danger); background: var(--danger-soft); }
.badge-info { color: var(--primary-dark); background: var(--primary-soft); }
.badge-neutral { color: var(--muted); background: var(--surface-soft); }
.badge-no-dot::before { display: none; }

.alert { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 20px; padding: 14px 16px; border: 1px solid #d7e2e6; border-radius: 10px; color: var(--ink-2); background: var(--navy-soft); font-size: 13px; }
.alert .icon { width: 18px; height: 18px; margin-top: 2px; }
.alert p { margin: 0; color: inherit; }
.alert-demo { color: #76521d; border-color: #ead5ad; background: var(--warning-soft); }
.alert-error { color: #8e3c3c; border-color: #edcfcb; background: var(--danger-soft); }
.alert-success { color: #285f4e; border-color: #cce3d8; background: var(--success-soft); }
.disclaimer { display: flex; align-items: flex-start; gap: 7px; margin-top: 16px; color: var(--muted); font-size: 12px; }
.disclaimer .icon { width: 15px; height: 15px; margin-top: 2px; }

.report-summary { display: grid; grid-template-columns: 190px 1fr; gap: 28px; align-items: center; padding: 26px; }
.report-score { padding-right: 26px; border-right: 1px solid var(--line); text-align: center; }
.report-score-value { color: var(--primary-dark); font-size: 48px; font-weight: 750; line-height: 1.2; }
.report-score-label { color: var(--muted); font-size: 12px; }
.report-summary-text h2 { margin-bottom: 9px; font-size: 19px; }
.report-summary-text p { margin: 0; }
.report-meta { display: flex; flex-wrap: wrap; gap: 10px 20px; margin-top: 16px; color: var(--muted); font-size: 12px; }
.segments-panel { margin-top: 22px; }
.segment-list { display: grid; gap: 14px; }
.segment { display: grid; grid-template-columns: 88px 1fr; gap: 18px; padding: 18px; border: 1px solid var(--line); border-left-width: 3px; border-radius: 10px; }
.segment-human { border-left-color: #50816c; background: #fbfdfc; }
.segment-ai { border-left-color: #527b9a; background: #f9fbfd; }
.segment-suspect { border-left-color: #b58642; background: #fffdf8; }
.segment-label { padding-top: 2px; font-size: 12px; font-weight: 700; }
.segment-human .segment-label { color: var(--success); }
.segment-ai .segment-label { color: #3e6f92; }
.segment-suspect .segment-label { color: var(--warning); }
.segment-probability { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; font-weight: 400; }
.segment-text { margin: 0; color: var(--ink-2); white-space: pre-wrap; word-break: break-word; }
.original-text { color: var(--ink-2); white-space: pre-wrap; word-break: break-word; }
.upsell { margin-top: 22px; padding: 26px; border: 1px solid #c9dfdb; border-radius: var(--radius); background: var(--primary-soft); text-align: center; }
.upsell h3 { margin-bottom: 8px; }
.upsell p { margin-bottom: 18px; color: #476d68; }

.order-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.order-product { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 22px; padding: 24px; border: 1px solid #c9dfdb; border-radius: var(--radius); background: var(--primary-soft); }
.order-product h2 { margin-bottom: 6px; font-size: 20px; }
.order-product p { margin: 0; color: #476d68; font-size: 13px; }
.order-product-price { flex: 0 0 auto; color: var(--primary-dark); font-size: 28px; font-weight: 700; }
.support-side { padding: 22px; text-align: center; }
.support-side h3 { margin-bottom: 6px; font-size: 16px; }
.support-side p { font-size: 12px; }
.support-side img { width: 172px; height: 172px; margin: 16px auto; object-fit: cover; border: 1px solid var(--line); border-radius: 8px; }
.support-side .qr-fallback { width: 172px; height: 172px; margin: 16px auto; }
.order-number { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }
.order-success { text-align: center; }
.order-success .success-icon { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 16px; border-radius: 50%; color: var(--success); background: var(--success-soft); }
.order-success .order-number-large { margin: 16px 0; padding: 12px; border-radius: 8px; background: var(--surface-soft); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; word-break: break-all; }
.order-success img { width: 160px; height: 160px; margin: 16px auto; object-fit: cover; border: 1px solid var(--line); border-radius: 8px; }

.profile-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 22px; align-items: start; }
.profile-card { padding: 28px; text-align: center; }
.profile-avatar { display: grid; place-items: center; width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 50%; color: var(--primary-dark); background: var(--primary-soft); font-size: 26px; font-weight: 700; }
.profile-card h2 { margin-bottom: 5px; font-size: 18px; word-break: break-all; }
.profile-card p { color: var(--muted); font-size: 12px; }
.profile-card .btn { margin-top: 14px; }
.definition-list { margin: 0; }
.definition-row { display: flex; justify-content: space-between; gap: 24px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.definition-row:first-child { padding-top: 0; }
.definition-row:last-child { padding-bottom: 0; border-bottom: 0; }
.definition-row dt { color: var(--muted); }
.definition-row dd { margin: 0; font-weight: 600; text-align: right; word-break: break-word; }
.admin-bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; padding: 18px 22px; border: 1px solid #d7e2e6; border-radius: var(--radius); background: var(--navy-soft); }
.admin-bar h2 { margin-bottom: 3px; font-size: 16px; }
.admin-bar p { margin: 0; color: var(--muted); font-size: 12px; }
.admin-note { max-width: 600px; margin-top: 18px; color: var(--muted); font-size: 12px; }
.admin-tabs { display: flex; gap: 6px; width: fit-content; margin-bottom: 20px; padding: 5px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.admin-tab { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 18px; border: 0; border-radius: 7px; color: var(--ink-2); background: transparent; font-size: 14px; font-weight: 600; cursor: pointer; }
.admin-tab .icon { width: 17px; height: 17px; }
.admin-tab:hover { color: var(--primary-dark); background: var(--surface-soft); }
.admin-tab.active { color: var(--primary-dark); background: var(--primary-soft); }
.panel-subtitle { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.quota-search-panel { margin-bottom: 22px; }
.quota-search-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.quota-search-input { min-width: 0; }
.quota-search-hint { display: flex; align-items: flex-start; gap: 9px; margin-top: 20px; padding: 13px 15px; border-radius: 9px; color: var(--muted); background: var(--surface-soft); font-size: 12px; }
.quota-search-hint .icon { width: 17px; height: 17px; margin-top: 1px; }
.quota-inline-alert { margin: 20px 0 0; }
.quota-result-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 22px 0 12px; }
.quota-user-table .table-title { max-width: 300px; }
.quota-uid { display: inline-block; max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; font-size: 12px; }
.quota-user-table tr.is-selected, .quota-user-table tbody tr.is-selected:hover { background: var(--primary-soft); }
.mobile-records .record-card.is-selected { background: var(--primary-soft); }
.quota-detail-panel { overflow: hidden; }
.quota-user-identity { margin: 5px 0 0; color: var(--muted); font-size: 12px; word-break: break-all; }
.entitlement-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.entitlement-item { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: #fafbf9; }
.entitlement-item > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; }
.entitlement-item strong { display: block; overflow: hidden; text-overflow: ellipsis; color: var(--ink); font-size: 23px; line-height: 1.3; white-space: nowrap; }
.entitlement-item strong small { color: var(--muted); font-size: 12px; font-weight: 400; }
.entitlement-item.entitlement-primary { border-color: #d1e4e0; background: var(--primary-soft); }
.entitlement-item.entitlement-primary strong { color: var(--primary-dark); }
.quota-action-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 24px; }
.quota-action-card { display: flex; align-items: flex-start; flex-direction: column; min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.quota-action-icon { display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: 14px; border-radius: 9px; color: var(--primary-dark); background: var(--primary-soft); }
.quota-action-icon .icon { width: 18px; height: 18px; }
.quota-action-card h3 { margin-bottom: 7px; font-size: 15px; }
.quota-action-card p { min-height: 40px; margin-bottom: 15px; color: var(--muted); font-size: 12px; }
.quota-action-card small { margin-top: 8px; color: var(--muted); font-size: 11px; }
.quota-action-card.quota-action-danger { border-color: #ead5d1; background: #fffafa; }
.quota-action-danger .quota-action-icon { color: var(--danger); background: var(--danger-soft); }
.quota-orders-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 24px; border-top: 1px solid var(--line); }
.quota-orders-heading h3 { margin: 0; font-size: 16px; }
.quota-order-table { min-width: 1080px; }
.quota-confirm-list .definition-row dd { max-width: 70%; overflow-wrap: anywhere; }

.empty-state, .error-state, .loading-state { padding: 64px 24px; text-align: center; }
.state-icon { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 18px; border-radius: 50%; color: var(--muted); background: var(--surface-soft); }
.state-icon .icon { width: 25px; height: 25px; }
.empty-state h2, .error-state h2, .loading-state h2 { margin-bottom: 8px; font-size: 19px; }
.empty-state p, .error-state p, .loading-state p { max-width: 440px; margin: 0 auto 20px; color: var(--muted); font-size: 13px; }
.error-state .state-icon { color: var(--danger); background: var(--danger-soft); }
.spinner { width: 26px; height: 26px; margin: 0 auto 16px; border: 3px solid #d9e4e3; border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
.btn-busy .spinner { width: 15px; height: 15px; margin: 0; border-width: 2px; border-color: rgba(255,255,255,.35); border-top-color: currentColor; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { border-radius: 6px; background: #e9edeb; animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }

.form-group { margin-bottom: 18px; }
.form-label { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 7px; font-size: 13px; font-weight: 600; }
.form-label small { color: var(--muted); font-weight: 400; }
.form-input, .form-textarea, .form-select {
  display: block; width: 100%; padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: 8px;
  color: var(--ink); background: #fff; outline: none; transition: border-color .18s, box-shadow .18s;
}
.form-input:focus, .form-textarea:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(19,127,121,.1); }
.form-input:disabled { color: var(--muted); background: var(--surface-soft); }
.form-textarea { min-height: 104px; resize: vertical; }
.form-help { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.form-error { margin: 8px 0 0; color: var(--danger); font-size: 12px; }
.code-row { display: grid; grid-template-columns: 1fr auto; gap: 9px; }
.code-row .btn { min-width: 112px; }
.demo-code { display: flex; align-items: flex-start; gap: 8px; margin: -5px 0 18px; padding: 10px 12px; border: 1px solid #ead5ad; border-radius: 8px; color: #76521d; background: var(--warning-soft); font-size: 12px; }
.demo-code .icon { width: 16px; height: 16px; margin-top: 2px; }
.local-admin { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.local-admin button { padding: 0; border: 0; color: var(--primary); background: none; cursor: pointer; }
.checkbox-label { display: flex; align-items: flex-start; gap: 9px; color: var(--ink-2); font-size: 13px; }
.checkbox-label input { margin-top: 5px; accent-color: var(--primary); }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px;
  background: rgba(10, 25, 40, .52); animation: fade-in .16s ease;
}
.modal {
  width: min(460px, 100%); max-height: calc(100vh - 48px); overflow-y: auto;
  border: 1px solid rgba(255,255,255,.5); border-radius: 16px; background: var(--surface); box-shadow: 0 24px 70px rgba(10,25,40,.2);
  animation: modal-in .2s ease;
}
.modal-wide { width: min(640px, 100%); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 24px 24px 0; }
.modal-heading { display: flex; gap: 13px; align-items: center; }
.modal-brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: #fff; background: var(--ink); }
.modal-header h2 { margin: 0 0 4px; font-size: 21px; }
.modal-header p { margin: 0; color: var(--muted); font-size: 12px; }
.modal-body { padding: 24px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 0 24px 24px; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.toast-region { position: fixed; right: 24px; bottom: 24px; z-index: 150; display: grid; gap: 10px; width: min(380px, calc(100% - 32px)); pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 11px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); box-shadow: var(--shadow); pointer-events: auto; animation: toast-in .22s ease; }
.toast .icon { width: 19px; height: 19px; margin-top: 2px; color: var(--primary); }
.toast-error .icon { color: var(--danger); }
.toast-warning .icon { color: var(--warning); }
.toast-content { flex: 1; color: var(--ink-2); font-size: 13px; }
.toast-close { width: 24px; height: 24px; margin: -2px -5px 0 0; }
.toast-close .icon { width: 15px; height: 15px; color: var(--muted); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.print-view { display: none; }
@media print {
  body > *:not(.print-view) { display: none !important; }
  body.printing { color: #111; background: #fff; font-size: 11pt; }
  body.printing .print-view { display: block; padding: 24px; }
  .print-header { display: flex; justify-content: space-between; align-items: center; padding-bottom: 16px; border-bottom: 2px solid #152b45; }
  .print-header img { width: 130px; }
  .print-header span { color: #555; font-size: 10pt; }
  .print-view h1 { margin: 24px 0 8px; font-size: 22pt; }
  .print-view h2 { margin: 24px 0 12px; font-size: 15pt; }
  .print-view p { color: #222; }
  .print-meta { color: #555; font-size: 9pt; }
  .print-summary { padding: 14px; border: 1px solid #bbb; }
  .print-segment { margin-top: 12px; padding: 12px; border: 1px solid #ccc; break-inside: avoid; }
  .print-segment strong { display: block; margin-bottom: 5px; }
  .print-disclaimer { margin-top: 24px; padding-top: 12px; border-top: 1px solid #bbb; color: #555; font-size: 9pt; }
}

@media (max-width: 1050px) {
  .header-inner { gap: 14px; }
  .brand img { width: 137px; }
  .nav-link { padding: 8px; font-size: 13px; }
  .header-actions .user-email { display: none; }
  .hero-grid { gap: 40px; }
  .workspace-grid { grid-template-columns: minmax(0, 1fr) 280px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .entitlement-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quota-action-grid { grid-template-columns: 1fr; }
  .quota-action-card p { min-height: 0; }
}

@media (max-width: 820px) {
  .container { width: min(100% - 32px, var(--container)); }
  .header-inner { height: 66px; }
  .brand img { width: 143px; }
  .mobile-menu-button { display: inline-grid; margin-left: auto; }
  .main-nav {
    position: absolute; top: 66px; left: 0; right: 0; display: none; align-items: stretch;
    padding: 12px 16px 18px; border-bottom: 1px solid var(--line); background: var(--bg); box-shadow: var(--shadow-sm);
  }
  .main-nav.open { display: grid; }
  .nav-link { padding: 11px 13px; text-align: left; }
  .header-actions { margin-left: 0; }
  .header-actions .user-chip { display: none; }
  .header-actions .btn { min-height: 38px; padding: 8px 12px; }
  .hero { padding: 50px 0; }
  .hero-grid { grid-template-columns: 1fr; gap: 50px; }
  .hero-copy { max-width: 650px; }
  .hero h1 { font-size: 46px; }
  .report-preview { max-width: 600px; width: 100%; margin: 0 auto; }
  .trust-grid { grid-template-columns: repeat(2, 1fr); }
  .trust-item:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .trust-item:nth-child(4) { border-top: 1px solid var(--line); }
  .section { padding: 62px 0; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { gap: 24px; }
  .step:not(:last-child)::after { display: none; }
  .support-card { grid-template-columns: 1fr 180px; gap: 28px; padding: 32px; }
  .workspace-grid, .order-layout { grid-template-columns: 1fr; }
  .workspace-side { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
  .tip-card { margin-top: 0; }
  .order-support { max-width: none; }
  .profile-grid { grid-template-columns: 1fr; }
  .profile-card { text-align: left; }
  .profile-avatar { margin-left: 0; }
}

@media (max-width: 600px) {
  .container { width: min(100% - 28px, var(--container)); }
  .header-actions .btn-header-logout { display: none; }
  .hero { padding: 40px 0; }
  .hero h1 { font-size: 38px; }
  .hero-lead { font-size: 16px; }
  .hero-actions .btn { flex: 1; min-width: 140px; }
  .preview-card { padding: 18px; }
  .preview-score { grid-template-columns: 88px 1fr; gap: 16px; padding: 15px; }
  .score-ring { width: 80px; height: 80px; border-width: 6px; }
  .score-ring strong { font-size: 23px; }
  .trust-item { padding: 18px 10px; }
  .trust-item strong { font-size: 16px; }
  .section { padding: 50px 0; }
  .section-header { margin-bottom: 28px; }
  .feature-grid, .steps, .pricing-layout { grid-template-columns: 1fr; }
  .feature-card, .price-card { padding: 24px; }
  .step { display: grid; grid-template-columns: 44px 1fr; column-gap: 15px; }
  .step-number { grid-row: span 2; width: 42px; height: 42px; margin: 0; }
  .step h3 { margin-top: 2px; }
  .support-card { grid-template-columns: 1fr; padding: 26px; }
  .support-qr { max-width: 200px; }
  .footer-inner { align-items: flex-start; flex-direction: column; }
  .footer-meta { text-align: left; }
  .app-page { padding: 28px 0 48px; }
  .page-heading { align-items: stretch; flex-direction: column; margin-bottom: 22px; }
  .page-heading h1 { font-size: 26px; }
  .page-actions .btn { flex: 1; }
  .panel-header, .panel-body { padding: 18px; }
  .editor-textarea { min-height: 360px; padding: 18px; }
  .panel-footer { padding: 14px 18px; }
  .editor-meta { align-items: flex-start; flex-direction: column; }
  .editor-actions { width: 100%; }
  .editor-actions .btn-primary { flex: 1; }
  .workspace-side { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 16px; }
  .stat-value { font-size: 23px; }
  .desktop-table { display: none; }
  .mobile-records { display: grid; }
  .record-card { padding: 18px; border-top: 1px solid var(--line); }
  .record-card:first-child { border-top: 0; }
  .record-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
  .record-title { margin: 0; font-size: 14px; word-break: break-word; }
  .record-meta { display: grid; gap: 5px; margin-bottom: 14px; color: var(--muted); font-size: 12px; }
  .record-actions { display: flex; flex-wrap: wrap; gap: 8px; }
  .report-summary { grid-template-columns: 1fr; gap: 18px; padding: 20px; }
  .report-score { padding: 0 0 18px; border-right: 0; border-bottom: 1px solid var(--line); }
  .report-score-value { font-size: 40px; }
  .segment { grid-template-columns: 1fr; gap: 7px; padding: 15px; }
  .segment-probability { display: inline; margin-left: 8px; }
  .order-product { align-items: flex-start; flex-direction: column; padding: 20px; }
  .order-product .btn { width: 100%; }
  .admin-bar { align-items: flex-start; flex-direction: column; }
  .admin-tabs { width: 100%; }
  .admin-tab { flex: 1; padding-right: 10px; padding-left: 10px; }
  .quota-search-form { grid-template-columns: 1fr; }
  .quota-search-form .btn { width: 100%; }
  .quota-result-heading, .quota-orders-heading { align-items: flex-start; flex-direction: column; gap: 5px; }
  .quota-orders-heading { padding: 16px 18px; }
  .quota-detail-panel > .panel-header { align-items: flex-start; flex-direction: column; }
  .entitlement-grid { gap: 9px; }
  .entitlement-item { padding: 13px; }
  .entitlement-item strong { font-size: 20px; }
  .quota-action-card .btn { width: 100%; }
  .quota-confirm-list .definition-row { align-items: flex-start; flex-direction: column; gap: 5px; }
  .quota-confirm-list .definition-row dd { max-width: 100%; text-align: left; }
  .modal-backdrop { align-items: end; padding: 0; }
  .modal { width: 100%; max-height: 92vh; border-radius: 16px 16px 0 0; }
  .modal-header { padding: 20px 20px 0; }
  .modal-body { padding: 20px; }
  .modal-footer { padding: 0 20px 20px; }
  .modal-footer .btn { flex: 1; }
  .toast-region { right: 16px; bottom: 16px; }
  .code-row { grid-template-columns: 1fr; }
  .code-row .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
