* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #f4f6fa; --panel: #ffffff; --ink: #1a2433; --muted: #7a8799;
  --line: #e3e8f0; --brand: #1f5fd0; --brand-dark: #174ba8; --soft: #eef3ff;
  --ok: #16936b; --warn: #d9822b; --danger: #d94545;
}
body { font-family: -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif; color: var(--ink); background: var(--bg); font-size: 14px; }
.app { display: flex; min-height: 100vh; }

/* sidebar */
.sidebar { width: 250px; background: #101a2b; color: #fff; display: flex; flex-direction: column; flex-shrink: 0; }
.brand { display: flex; align-items: center; gap: 12px; padding: 22px 20px; border-bottom: 1px solid #233049; }
.brand-mark { width: 38px; height: 38px; border-radius: 9px; background: linear-gradient(135deg,#3b82f6,#1f5fd0); display: grid; place-items: center; font-weight: 800; font-size: 13px; letter-spacing: .5px; }
.brand-title { font-weight: 700; font-size: 15px; }
.brand-sub { font-size: 11px; color: #8fa0bd; margin-top: 3px; }
.nav { padding: 14px 12px; flex: 1; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 11px 12px; border: 0; background: transparent; color: #b8c4d8; font-size: 14px; border-radius: 8px; cursor: pointer; text-align: left; }
.nav-item:hover { background: #1a2940; color: #fff; }
.nav-item.active { background: #1e3a63; color: #fff; font-weight: 600; }
.nav-item span { font-size: 15px; }
.nav-item em { margin-left: auto; background: var(--danger); color: #fff; font-style: normal; font-size: 11px; padding: 1px 7px; border-radius: 10px; }
.sidebar-foot { padding: 18px; border-top: 1px solid #233049; }
.client-label { font-size: 11px; color: #8fa0bd; margin-bottom: 7px; }
.client-select { width: 100%; padding: 9px 10px; border-radius: 7px; border: 1px solid #33425c; background: #18263c; color: #fff; font-size: 13px; }
.preview-links { display: flex; gap: 10px; margin-top: 12px; }
.preview-links a { color: #7fb0ff; font-size: 12px; text-decoration: none; }
.preview-links a:hover { text-decoration: underline; }

/* main */
.main { flex: 1; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 22px 32px; background: var(--panel); border-bottom: 1px solid var(--line); }
.topbar h1 { font-size: 21px; }
.topbar p { margin-top: 4px; font-size: 12px; }
.muted { color: var(--muted); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.save-state { font-size: 12px; color: var(--muted); }
.save-state.ok { color: var(--ok); }
.save-state.err { color: var(--danger); }
.btn { padding: 9px 16px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: 13px; cursor: pointer; font-weight: 600; }
.btn:hover { filter: brightness(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-ghost { background: #fff; color: var(--ink); }

.view { display: none; padding: 24px 32px 60px; }
.view.active { display: block; }

/* content tabs */
.content-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; flex-wrap: wrap; }
.tab { padding: 10px 16px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 14px; border-bottom: 2px solid transparent; }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

/* editor */
.editor { max-width: 900px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; margin-bottom: 16px; }
.card-title { font-weight: 700; font-size: 15px; margin-bottom: 4px; display: flex; justify-content: space-between; align-items: center; }
.card-desc { color: var(--muted); font-size: 12px; margin-bottom: 16px; }
.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 12px; color: #55637a; font-weight: 600; margin-bottom: 6px; }
.field input, .field textarea, .field select { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px; font-size: 13px; font-family: inherit; background: #fff; color: var(--ink); }
.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid var(--soft); border-color: var(--brand); }
.field textarea { min-height: 76px; resize: vertical; line-height: 1.6; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 0 14px; }

/* lang tabs */
.lang-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.lang-tab { padding: 5px 12px; border-radius: 20px; border: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 12px; cursor: pointer; }
.lang-tab.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.lang-pane { display: none; }
.lang-pane.active { display: block; }

/* list items */
.item { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 12px; background: #fff; overflow: hidden; }
.item-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: #f9fbfe; cursor: pointer; }
.item-head:hover { background: #f2f6fd; }
.item-title { font-weight: 600; flex: 1; }
.item-title small { color: var(--muted); font-weight: 400; margin-left: 8px; }
.item-body { padding: 16px; border-top: 1px solid var(--line); display: none; }
.item.open .item-body { display: block; }
.item-actions { display: flex; gap: 6px; }
.icon-btn { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 4px 9px; font-size: 12px; cursor: pointer; color: var(--muted); }
.icon-btn:hover { color: var(--danger); border-color: var(--danger); }
.icon-btn.up:hover, .icon-btn.down:hover { color: var(--brand); border-color: var(--brand); }
.add-btn { width: 100%; padding: 11px; border: 1px dashed #b9c6db; background: #f9fbfe; color: var(--brand); border-radius: 9px; cursor: pointer; font-weight: 600; }
.add-btn:hover { background: var(--soft); }

/* sections (body copy) */
.section-block { border-left: 3px solid var(--brand); padding-left: 14px; margin-bottom: 16px; }
.section-block-head { display: flex; justify-content: space-between; margin-bottom: 8px; }
.section-block-head b { font-size: 12px; color: var(--brand); }
.para-row { display: flex; gap: 6px; margin-bottom: 6px; }
.para-row textarea { flex: 1; }
.mini-add { padding: 4px 10px; font-size: 12px; border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer; color: var(--brand); }
.danger-text { color: var(--danger); }

/* theme */
.color-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.color-row input[type=color] { width: 44px; height: 36px; border: 1px solid var(--line); border-radius: 6px; padding: 2px; background: #fff; cursor: pointer; }
.color-row input[type=text] { width: 110px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; font-family: monospace; }
.color-row label { width: 110px; font-size: 13px; }

/* inquiries */
.inq-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.filter { display: flex; align-items: center; gap: 8px; }
.filter label { font-size: 13px; color: var(--muted); }
.filter select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; min-width: 180px; }
.inq-list { display: grid; gap: 12px; }
.inq-card { background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: 18px 20px; }
.inq-top { display: flex; justify-content: space-between; align-items: flex-start; }
.inq-who { font-weight: 700; font-size: 15px; }
.inq-meta { color: var(--muted); font-size: 12px; margin-top: 4px; }
.inq-badge { padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.inq-badge.new { background: #fdecec; color: var(--danger); }
.inq-badge.read { background: #fff4e5; color: var(--warn); }
.inq-badge.done { background: #e6f6f0; color: var(--ok); }
.inq-msg { margin: 14px 0; padding: 12px 14px; background: #f8fafd; border-radius: 8px; line-height: 1.65; white-space: pre-wrap; }
.inq-actions { display: flex; gap: 8px; align-items: center; }
.inq-actions select { padding: 6px 9px; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; }
.empty { text-align: center; color: var(--muted); padding: 60px 20px; background: var(--panel); border-radius: 12px; border: 1px dashed var(--line); }

/* guide */
.guide { max-width: 820px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 26px 30px; }
.guide h2 { margin-bottom: 14px; }
.guide h3 { margin: 22px 0 10px; }
.guide ol { padding-left: 22px; line-height: 2.1; }
.tip { margin-top: 18px; padding: 14px 16px; background: var(--soft); border-radius: 8px; color: #2b4b86; line-height: 1.7; }
.guide pre { background: #101a2b; color: #a8c8ff; padding: 16px; border-radius: 8px; font-size: 12px; overflow: auto; line-height: 1.7; }

/* toast */
.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px); background: #101a2b; color: #fff; padding: 12px 22px; border-radius: 9px; font-size: 13px; opacity: 0; pointer-events: none; transition: .25s; z-index: 99; box-shadow: 0 8px 30px rgba(0,0,0,.2); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* client registry */
.reg-list { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.reg-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.reg-table th { text-align: left; padding: 12px 10px; background: var(--soft); color: var(--ink); font-weight: 600; white-space: nowrap; border-bottom: 1px solid var(--line); }
.reg-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.reg-table tr:last-child td { border-bottom: 0; }
.reg-table input, .reg-table select { width: 100%; min-width: 110px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; background: #fff; color: var(--ink); }
.reg-table input:focus, .reg-table select:focus { outline: 2px solid rgba(37,99,235,.2); border-color: #2563eb; }

@media (max-width: 900px) {
  .sidebar { width: 200px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .topbar, .view { padding-left: 18px; padding-right: 18px; }
}
