@charset "utf-8";
/* ============================================================
   心商营造 · 古建筑设计综合服务平台
   基础层：变量 / 重置 / 排版 / 控件
   ============================================================ */

:root {
    --ink-950: #0f0d0a;
    --ink-900: #17130f;
    --ink-850: #1c1712;
    --ink-800: #221c15;
    --ink-700: #2e261c;
    --ink-600: #3d3326;
    --ink-500: #5a4b38;
    --paper: #f5efe3;
    --paper-2: #ede4d2;
    --paper-3: #e3d7c1;
    --cream: #fcf8f0;
    --line: rgba(122, 96, 58, .16);
    --line-strong: rgba(122, 96, 58, .3);
    --gold: #b1874c;
    --gold-2: #d4b47c;
    --gold-3: #8f6a34;
    --gold-soft: rgba(177, 135, 76, .12);
    --cinnabar: #a4402f;
    --cinnabar-2: #c25d45;
    --cinnabar-soft: rgba(164, 64, 47, .1);
    --jade: #4c6d5f;
    --jade-soft: rgba(76, 109, 95, .12);
    --blue-ink: #4b5f78;
    --blue-soft: rgba(75, 95, 120, .12);
    --violet: #6c5b7b;
    --text: #2b251d;
    --text-2: #4a4033;
    --muted: #7d6f5b;
    --faint: #a2937a;
    --shadow-sm: 0 1px 2px rgba(38, 28, 15, .05), 0 8px 18px -14px rgba(38, 28, 15, .5);
    --shadow-md: 0 2px 6px rgba(38, 28, 15, .06), 0 26px 50px -28px rgba(38, 28, 15, .45);
    --shadow-lg: 0 30px 90px -32px rgba(18, 13, 7, .6);
    --radius: 14px;
    --radius-sm: 9px;
    --radius-lg: 22px;
    --sidebar-w: 254px;
    --topbar-h: 68px;
    --font-serif: "Songti SC", "STSong", "SimSun", Georgia, serif;
    --font-sans: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", system-ui, -apple-system, sans-serif;
    --font-num: Georgia, "Times New Roman", serif;
    --ease: cubic-bezier(.22, .68, .32, 1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, h5, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
table { border-collapse: collapse; width: 100%; }
::selection { background: rgba(177, 135, 76, .25); color: var(--ink-900); }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(122, 96, 58, .25); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(122, 96, 58, .45); background-clip: content-box; }

.serif { font-family: var(--font-serif); }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.cinnabar { color: var(--cinnabar); }
.gold { color: var(--gold); }
.jade { color: var(--jade); }
.tc { text-align: center; }
.tr { text-align: right; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flex { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-10 { gap: 10px; } .gap-14 { gap: 14px; } .gap-20 { gap: 20px; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.w-100 { width: 100%; }
.hidden { display: none !important; }

/* ---------- 按钮 ---------- */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 38px;
    padding: 0 16px;
    border-radius: 8px;
    border: 1px solid var(--line-strong);
    background: rgba(255, 252, 245, .7);
    color: var(--text-2);
    font-size: 13px;
    letter-spacing: .02em;
    transition: all .22s var(--ease);
    white-space: nowrap;
}
.btn:hover { border-color: var(--gold); color: var(--ink-900); background: #fffdf7; box-shadow: 0 6px 18px -12px rgba(122, 96, 58, .7); }
.btn:active { transform: translateY(1px); }
.btn i { font-size: 12px; }
.btn-primary {
    background: linear-gradient(140deg, #2a2219, #17130f);
    border-color: #3d3326;
    color: #f4e9d4;
    box-shadow: 0 10px 24px -16px rgba(15, 13, 10, .9);
}
.btn-primary:hover { background: linear-gradient(140deg, #3a2f22, #221c15); color: #f8efd9; border-color: var(--gold); }
.btn-gold {
    background: linear-gradient(140deg, #c9a468, #a87e42);
    border-color: #a87e42;
    color: #1c1712;
    font-weight: 600;
    box-shadow: 0 12px 26px -18px rgba(122, 86, 36, .9);
}
.btn-gold:hover { background: linear-gradient(140deg, #d8b57b, #b48a4c); color: #17130f; border-color: #8f6a34; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: rgba(177, 135, 76, .09); border-color: transparent; color: var(--ink-900); }
.btn-danger { color: var(--cinnabar); border-color: rgba(164, 64, 47, .3); background: rgba(164, 64, 47, .04); }
.btn-danger:hover { background: var(--cinnabar); color: #fff5ef; border-color: var(--cinnabar); }
.btn-sm { height: 31px; padding: 0 11px; font-size: 12px; border-radius: 7px; }
.btn-xs { height: 26px; padding: 0 8px; font-size: 11px; border-radius: 6px; gap: 4px; }
.btn-lg { height: 46px; padding: 0 26px; font-size: 14.5px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }
.btn-icon { width: 38px; padding: 0; }
.btn-mini {
    display: inline-flex; align-items: center; gap: 4px;
    height: 27px; padding: 0 8px; border-radius: 6px;
    font-size: 12px; color: var(--text-2);
    border: 1px solid transparent;
    transition: all .18s var(--ease);
}
.btn-mini:hover { color: var(--ink-900); background: rgba(177, 135, 76, .1); border-color: rgba(177, 135, 76, .22); }
.btn-mini.danger { color: var(--cinnabar); }
.btn-mini.danger:hover { background: rgba(164, 64, 47, .08); border-color: rgba(164, 64, 47, .22); }
.btn-mini i { font-size: 11px; }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label {
    font-size: 12px;
    color: var(--muted);
    letter-spacing: .06em;
    display: flex; align-items: center; gap: 4px;
}
.field > label .req { color: var(--cinnabar); font-size: 13px; }
.field .hint { font-size: 11.5px; color: var(--faint); line-height: 1.5; }
.input, .select, .textarea {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    background: rgba(255, 252, 246, .82);
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    color: var(--text);
    outline: none;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.textarea { height: auto; min-height: 92px; padding: 10px 12px; resize: vertical; line-height: 1.7; }
.input::placeholder, .textarea::placeholder { color: #b4a58e; }
.input:focus, .select:focus, .textarea:focus {
    border-color: var(--gold);
    background: #fffdf8;
    box-shadow: 0 0 0 3px rgba(177, 135, 76, .14);
}
.select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, #8b7b63 50%), linear-gradient(135deg, #8b7b63 50%, transparent 50%);
    background-position: calc(100% - 16px) 17px, calc(100% - 11px) 17px;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 32px;
}
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid .span-2 { grid-column: span 2; }
.form-section { margin-bottom: 22px; }
.form-section-title {
    display: flex; align-items: center; gap: 8px;
    font-family: var(--font-serif);
    font-size: 15px;
    color: var(--ink-800);
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--line);
}
.form-section-title::before { content: ""; width: 3px; height: 14px; background: var(--gold); border-radius: 2px; }
.checkbox, .radio { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-size: 13px; color: var(--text-2); }
.checkbox input, .radio input { accent-color: var(--gold-3); width: 15px; height: 15px; }
.switch { position: relative; width: 38px; height: 21px; border-radius: 20px; background: rgba(122, 96, 58, .25); transition: .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%; background: #fff; transition: .2s; }
.switch.on { background: var(--gold); }
.switch.on::after { left: 20px; }

/* ---------- 徽标 / 标签 ---------- */
.chip {
    display: inline-flex; align-items: center; gap: 5px;
    height: 23px; padding: 0 9px;
    border-radius: 5px;
    font-size: 11.5px;
    letter-spacing: .02em;
    background: rgba(122, 96, 58, .08);
    color: var(--muted);
    white-space: nowrap;
    border: 1px solid transparent;
}
.chip .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.chip-gold { background: var(--gold-soft); color: #8a6426; border-color: rgba(177, 135, 76, .18); }
.chip-jade { background: var(--jade-soft); color: #3f5f51; border-color: rgba(76, 109, 95, .18); }
.chip-red { background: var(--cinnabar-soft); color: #93372a; border-color: rgba(164, 64, 47, .18); }
.chip-blue { background: var(--blue-soft); color: #445972; border-color: rgba(75, 95, 120, .18); }
.chip-violet { background: rgba(108, 91, 123, .1); color: #5e4f6c; border-color: rgba(108, 91, 123, .18); }
.chip-gray { background: rgba(90, 75, 56, .07); color: #7c6f5c; }
.chip-dark { background: rgba(23, 19, 15, .85); color: #e9dcc4; }
.chip-line { background: transparent; border-color: var(--line-strong); }
.tag-level { font-size: 10.5px; letter-spacing: .12em; padding: 2px 6px; border: 1px solid currentColor; border-radius: 3px; }

/* ---------- 提示 ---------- */
.toast-wrap { position: fixed; top: 22px; right: 26px; z-index: 9000; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast {
    pointer-events: auto;
    display: flex; align-items: flex-start; gap: 11px;
    min-width: 290px; max-width: 400px;
    padding: 13px 16px 13px 14px;
    border-radius: 10px;
    background: linear-gradient(140deg, #2b241b, #17130f);
    color: #f1e7d4;
    box-shadow: 0 18px 40px -18px rgba(15, 13, 10, .8);
    border: 1px solid rgba(177, 135, 76, .28);
    animation: toastIn .4s var(--ease) both;
}
.toast.out { animation: toastOut .3s var(--ease) both; }
.toast .ic { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: rgba(177, 135, 76, .18); color: var(--gold-2); font-size: 12px; flex: none; }
.toast .tt { font-size: 13px; line-height: 1.5; }
.toast .ts { font-size: 11px; color: rgba(241, 231, 212, .55); margin-top: 2px; }
.toast.success .ic { background: rgba(76, 109, 95, .28); color: #a9cbb9; }
.toast.error .ic { background: rgba(164, 64, 47, .3); color: #e4a394; }
.toast.warn .ic { background: rgba(177, 135, 76, .25); color: #e3c188; }

@keyframes toastIn { from { opacity: 0; transform: translateX(24px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(20px); } }

/* ---------- 工具 ---------- */
.divider { height: 1px; background: var(--line); }
.section-gap { height: 22px; }
.kbd {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 20px; height: 20px; padding: 0 5px;
    border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px;
    font-size: 10.5px; color: var(--muted); background: rgba(255, 252, 245, .6);
    font-family: var(--font-sans);
}
.text-link { color: #8a6426; border-bottom: 1px solid rgba(138, 100, 38, .3); padding-bottom: 1px; transition: .2s; }
.text-link:hover { color: var(--cinnabar); border-color: rgba(164, 64, 47, .4); }

.loading-bar { position: fixed; top: 0; left: 0; height: 2px; width: 0; background: linear-gradient(90deg, var(--gold-3), var(--gold-2)); z-index: 9999; transition: width .3s; box-shadow: 0 0 12px rgba(212, 180, 124, .8); }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
