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

:root {
    --brand-700: #17457a;
    --brand-600: #1f5fa8;
    --brand-500: #2f76c4;
    --brand-100: #e8f1fb;
    --brand-50: #f4f9ff;

    --bg: #f4f6f9;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --surface-3: #f1f5f9;

    --border: #e4e8ee;
    --border-strong: #d4dbe5;

    --text: #1f2937;
    --text-2: #475569;
    --muted: #6b7280;
    --faint: #94a3b8;

    --success: #15803d;
    --success-bg: #ecfdf3;
    --warning: #b45309;
    --warning-bg: #fff7ed;
    --danger: #b91c1c;
    --danger-bg: #fef2f2;
    --info: #1d4ed8;
    --info-bg: #eff6ff;

    --gold: var(--brand-600);
    --gold-2: var(--brand-500);
    --gold-3: var(--brand-700);
    --gold-soft: var(--brand-50);
    --cinnabar: var(--danger);
    --cinnabar-2: #dc2626;
    --cinnabar-soft: var(--danger-bg);
    --jade: var(--success);
    --jade-soft: var(--success-bg);
    --blue-ink: var(--info);
    --blue-soft: var(--info-bg);

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
    --shadow-md: 0 10px 30px -12px rgba(15, 23, 42, .18);
    --shadow-lg: 0 30px 70px -30px rgba(15, 23, 42, .35);

    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 14px;

    --sidebar-w: 236px;
    --topbar-h: 60px;

    --font-sans: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", Arial, sans-serif;
    --font-serif: var(--font-sans);
    --font-num: var(--font-sans);
    --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.6;
    -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(31, 95, 168, .16); color: var(--text); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; background-clip: content-box; }

.serif { font-family: var(--font-sans); }
.num { font-family: var(--font-sans); font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.cinnabar { color: var(--danger); }
.gold { color: var(--brand-600); }
.jade { color: var(--success); }
.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 {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    border-radius: 6px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text-2);
    font-size: 13px;
    transition: all .18s var(--ease);
    white-space: nowrap;
}
.btn:hover { border-color: var(--brand-500); color: var(--brand-600); background: var(--brand-50); }
.btn:active { transform: translateY(1px); }
.btn i { font-size: 12px; }
.btn-primary {
    background: var(--brand-600);
    border-color: var(--brand-600);
    color: #fff;
}
.btn-primary:hover { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }
.btn-gold {
    background: var(--brand-600);
    border-color: var(--brand-600);
    color: #fff;
    font-weight: 500;
}
.btn-gold:hover { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-3); border-color: transparent; color: var(--text); }
.btn-danger { color: var(--danger); border-color: #fecaca; background: #fff; }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-sm { height: 31px; padding: 0 11px; font-size: 12px; }
.btn-xs { height: 26px; padding: 0 8px; font-size: 11px; }
.btn-lg { height: 44px; padding: 0 24px; font-size: 14px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .55; pointer-events: none; }
.btn-icon { width: 36px; padding: 0; }
.btn-mini {
    display: inline-flex; align-items: center; gap: 4px;
    height: 26px; padding: 0 7px; border-radius: 4px;
    font-size: 12px; color: var(--brand-600);
    border: 1px solid transparent;
    transition: all .16s;
}
.btn-mini:hover { background: var(--brand-50); border-color: #dbeafe; }
.btn-mini.danger { color: var(--danger); }
.btn-mini.danger:hover { background: var(--danger-bg); border-color: #fecaca; }
.btn-mini i { font-size: 11px; }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label {
    font-size: 12.5px;
    color: var(--text-2);
    display: flex; align-items: center; gap: 4px;
}
.field > label .req { color: var(--danger); font-size: 13px; }
.field .hint { font-size: 11.5px; color: var(--faint); line-height: 1.5; }
.input, .select, .textarea {
    width: 100%;
    height: 38px;
    padding: 0 11px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    color: var(--text);
    outline: none;
    transition: border-color .18s, box-shadow .18s;
}
.textarea { height: auto; min-height: 88px; padding: 9px 11px; resize: vertical; line-height: 1.7; }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:focus, .select:focus, .textarea:focus {
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px rgba(31, 95, 168, .1);
}
.select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, #94a3b8 50%), linear-gradient(135deg, #94a3b8 50%, transparent 50%);
    background-position: calc(100% - 15px) 16px, calc(100% - 10px) 16px;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 30px;
}
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 16px; }
.form-grid .span-2 { grid-column: span 2; }
.form-section { margin-bottom: 20px; }
.form-section-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.form-section-title::before { content: ""; width: 3px; height: 14px; background: var(--brand-600); 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(--brand-600); width: 15px; height: 15px; }
.switch { position: relative; width: 38px; height: 21px; border-radius: 20px; background: #cbd5e1; 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(--brand-600); }
.switch.on::after { left: 20px; }

/* ---------- 标签 ---------- */
.chip {
    display: inline-flex; align-items: center; gap: 5px;
    height: 22px; padding: 0 8px;
    border-radius: 4px;
    font-size: 11.5px;
    background: var(--surface-3);
    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(--warning-bg); color: var(--warning); border-color: #fed7aa; }
.chip-jade { background: var(--success-bg); color: var(--success); border-color: #bbf7d0; }
.chip-red { background: var(--danger-bg); color: var(--danger); border-color: #fecaca; }
.chip-blue { background: var(--info-bg); color: var(--info); border-color: #bfdbfe; }
.chip-violet { background: #f5f3ff; color: #6d28d9; border-color: #ddd6fe; }
.chip-gray { background: var(--surface-3); color: var(--muted); border-color: var(--border); }
.chip-dark { background: #1e293b; color: #f1f5f9; }
.chip-line { background: var(--surface); border-color: var(--border-strong); color: var(--text-2); }
.tag-level { font-size: 10.5px; padding: 1px 6px; border: 1px solid currentColor; border-radius: 3px; }

/* ---------- 提示 ---------- */
.toast-wrap { position: fixed; top: 20px; right: 24px; z-index: 9000; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast {
    pointer-events: auto;
    display: flex; align-items: flex-start; gap: 10px;
    min-width: 280px; max-width: 400px;
    padding: 12px 15px;
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    border-left: 3px solid var(--success);
    animation: toastIn .28s var(--ease) both;
}
.toast.out { animation: toastOut .25s var(--ease) both; }
.toast .ic { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--success-bg); color: var(--success); font-size: 11px; flex: none; }
.toast .tt { font-size: 13px; line-height: 1.5; }
.toast .ts { font-size: 11px; color: var(--faint); margin-top: 2px; }
.toast.error { border-left-color: var(--danger); }
.toast.error .ic { background: var(--danger-bg); color: var(--danger); }
.toast.warn { border-left-color: #f59e0b; }
.toast.warn .ic { background: var(--warning-bg); color: var(--warning); }

@keyframes toastIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(16px); } }

/* ---------- 工具 ---------- */
.divider { height: 1px; background: var(--border); }
.text-link { color: var(--brand-600); transition: .18s; }
.text-link:hover { color: var(--brand-700); text-decoration: underline; }
.kbd {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 20px; height: 20px; padding: 0 5px;
    border: 1px solid var(--border-strong); border-radius: 4px;
    font-size: 10.5px; color: var(--muted); background: var(--surface-2);
}
.loading-bar { position: fixed; top: 0; left: 0; height: 2px; width: 0; background: var(--brand-600); z-index: 9999; transition: width .3s; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
