/* ============================================================
   松鹿部落 · 网站管理后台样式
   视觉：森林绿 + 暖白，简洁直观
   ============================================================ */
:root {
    --pine-900: #0b2a1d;
    --pine-800: #12402c;
    --pine-700: #1a5c3f;
    --pine-600: #24734f;
    --pine-500: #31905f;
    --pine-400: #4ba77a;
    --sage: #eef4ee;
    --paper: #f7f9f6;
    --card: #ffffff;
    --ink: #1d2b23;
    --ink-2: #5c6f63;
    --line: #e2e9e2;
    --warn: #c9780e;
    --danger: #c4452f;
    --shadow: 0 10px 30px -12px rgba(10, 40, 25, .25);
    --r: 12px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
    background: var(--paper);
    color: var(--ink);
    font-size: 14px;
}
.hidden { display: none !important; }
button, input { font: inherit; }
input {
    width: 100%;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 8px;
    padding: 9px 12px;
    color: var(--ink);
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
input:focus { border-color: var(--pine-500); box-shadow: 0 0 0 3px rgba(49, 144, 95, .15); }
.hidden-input { display: none; }

/* ---------- 按钮 ---------- */
.btn {
    border: none;
    cursor: pointer;
    padding: 9px 16px;
    border-radius: 9px;
    font-weight: 600;
    background: #fff;
    color: var(--ink);
    border: 1px solid var(--line);
    transition: transform .15s, box-shadow .15s, background .15s, color .15s;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn.primary { background: linear-gradient(135deg, var(--pine-600), var(--pine-800)); color: #fff; border: none; }
.btn.success { background: var(--pine-500); color: #fff; border: none; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--ink-2); }
.btn.ghost:hover { color: var(--pine-700); border-color: var(--pine-400); }
.btn.danger { color: var(--danger); border-color: rgba(196, 69, 47, .35); }
.btn.small { padding: 6px 12px; font-size: 13px; border-radius: 7px; }
a.link-btn {
    color: var(--ink-2);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 7px;
    transition: background .2s, color .2s;
}
a.link-btn:hover { background: rgba(255,255,255,.12); color: #fff; }
.muted { color: var(--ink-2); }

/* ---------- 登录页 ---------- */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(1200px 500px at 80% -10%, rgba(49, 144, 95, .35), transparent 60%),
        radial-gradient(900px 500px at -10% 110%, rgba(18, 64, 44, .5), transparent 55%),
        linear-gradient(160deg, #0b2a1d 0%, #145036 55%, #0b2a1d 100%);
    padding: 24px;
}
.login-card {
    width: 380px;
    background: rgba(255,255,255,.97);
    border-radius: 18px;
    padding: 34px 34px 26px;
    box-shadow: 0 30px 70px -20px rgba(0,0,0,.5);
}
.login-logo { text-align: center; margin-bottom: 22px; }
.login-mark {
    width: 62px; height: 62px;
    display: grid; place-items: center;
    margin: 0 auto 10px;
    border-radius: 18px;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(145deg, var(--pine-500), var(--pine-800));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 14px 24px -10px rgba(0,0,0,.4);
}
.login-mark svg { width: 34px; height: 34px; }
.login-mark img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.login-logo h1 { margin: 0; font-size: 20px; color: var(--pine-900); letter-spacing: .04em; }
.login-logo p { margin: 6px 0 0; font-size: 12px; color: var(--ink-2); }
.f-item { display: block; margin: 0 0 14px; }
.f-item > span {
    display: block;
    font-size: 12px;
    color: var(--ink-2);
    margin-bottom: 6px;
    font-weight: 600;
}
.login-card .btn { width: 100%; padding: 11px; margin-top: 6px; }
.login-tip { min-height: 18px; margin: 10px 0 0; font-size: 12px; color: var(--danger); text-align: center; }
.login-hint { margin: 12px 0 0; text-align: center; font-size: 11px; color: #9db0a4; }

/* ---------- 顶部 ---------- */
.app { display: flex; flex-direction: column; height: 100vh; }
.topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 18px;
    height: 62px;
    background: linear-gradient(120deg, var(--pine-900), var(--pine-800));
    color: #fff;
    box-shadow: 0 6px 18px -8px rgba(0,0,0,.4);
    position: relative;
    z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 250px; }
.brand-mark {
    width: 38px; height: 38px;
    display: grid; place-items: center;
    border-radius: 11px;
    overflow: hidden;
    font-weight: 800;
    font-size: 18px;
    color: var(--pine-900);
    background: linear-gradient(145deg, #cfe8d2, #a9d3ae);
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 15px; letter-spacing: .03em; }
.brand-text span { font-size: 11px; color: rgba(255,255,255,.6); }
.tabs { display: flex; gap: 4px; flex: 1; justify-content: center; }
.tab {
    background: transparent;
    border: none;
    color: rgba(255,255,255,.75);
    padding: 8px 16px;
    border-radius: 9px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, color .2s;
}
.tab:hover { background: rgba(255,255,255,.12); color: #fff; }
.tab.active { background: rgba(255,255,255,.2); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.tab-quick { color: #ffe0a8; }
.top-actions { display: flex; gap: 8px; align-items: center; min-width: 250px; justify-content: flex-end; }

/* ---------- 主体 ---------- */
.main { flex: 1; min-height: 0; position: relative; }
.editor-wrap { position: absolute; inset: 0; display: flex; flex-direction: column; }
.editor-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    background: var(--card);
    border-bottom: 1px solid var(--line);
}
.eb-left { display: flex; align-items: center; gap: 10px; }
.eb-left strong { font-size: 16px; color: var(--pine-900); }
.eb-right { display: flex; align-items: center; gap: 8px; }
.state-dot { width: 9px; height: 9px; border-radius: 50%; background: #9db0a4; }
.state-dot.on { background: #f0a63c; box-shadow: 0 0 0 4px rgba(240,166,60,.2); }
.editor-body { flex: 1; min-height: 0; position: relative; background: #dfe6e0; }
.editor-body iframe {
    width: 100%;
    height: 100%;
    border: 0;
    background: #fff;
    display: block;
}
.edit-tip {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(10, 42, 29, .92);
    color: #fff;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 13px;
    box-shadow: 0 10px 26px -8px rgba(0,0,0,.5);
    pointer-events: none;
    max-width: 80%;
    flex-wrap: wrap;
    justify-content: center;
    line-height: 1.6;
}
.edit-tip strong { color: #ffe0a8; }

/* ---------- 常用信息 ---------- */
.quick-wrap {
    position: absolute;
    inset: 0;
    overflow: auto;
    padding: 22px;
    background: var(--paper);
}
.quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 16px;
    max-width: 1280px;
    margin: 0 auto;
}
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 18px;
    box-shadow: 0 6px 18px -14px rgba(10,40,25,.3);
}
.card-wide { grid-column: 1 / -1; }
.card h3 {
    margin: 0 0 16px;
    font-size: 15px;
    color: var(--pine-900);
    display: flex;
    align-items: center;
    gap: 8px;
}
.card h3 .dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--pine-500), var(--pine-700));
    display: inline-block;
}
.field-list { display: grid; gap: 14px; }
.logo-row { display: flex; align-items: center; gap: 18px; }
.logo-preview {
    width: 96px; height: 96px;
    border-radius: 18px;
    background: linear-gradient(145deg, var(--pine-600), var(--pine-800));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 14px 26px -12px rgba(0,0,0,.45);
    display: grid;
    place-items: center;
    overflow: hidden;
    color: #fff;
    font-size: 13px;
    flex-shrink: 0;
}
.logo-preview img { width: 100%; height: 100%; object-fit: cover; display: none; }
.logo-preview.has img { display: block; }
.logo-preview.has span { display: none; }
.logo-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.hint { margin: 6px 0 0; font-size: 12px; color: var(--ink-2); line-height: 1.7; }
.ticket-editors { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.ticket-editor {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 14px;
    background: #fbfcfb;
}
.ticket-editor .tno {
    display: inline-block;
    font-weight: 800;
    font-size: 12px;
    color: #fff;
    background: linear-gradient(135deg, var(--pine-600), var(--pine-800));
    border-radius: 6px;
    padding: 2px 8px;
    margin-bottom: 12px;
}
.ticket-editor .f-item { margin-bottom: 10px; }
.quick-bottom {
    max-width: 1280px;
    margin: 18px auto 0;
    display: flex;
    align-items: center;
    gap: 14px;
}
.quick-bottom .hint { margin: 0; }

/* ---------- Toast ---------- */
.toast {
    position: fixed;
    top: 76px;
    left: 50%;
    transform: translate(-50%, -30px);
    background: rgba(10, 42, 29, .95);
    color: #fff;
    padding: 10px 20px;
    border-radius: 999px;
    font-size: 13px;
    box-shadow: 0 12px 30px -8px rgba(0,0,0,.5);
    opacity: 0;
    pointer-events: none;
    transition: all .3s;
    z-index: 1000;
    max-width: 80vw;
    line-height: 1.6;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.warn { background: rgba(201, 120, 14, .96); }

@media (max-width: 1100px) {
    .brand-text span { display: none; }
    .tabs .tab { padding: 8px 10px; }
    .top-actions { min-width: 0; }
}
