/* ============================================================
   农副产地直采协同系统 · 设计系统
   墨绿 / 米纸 / 麦金 —— 产地供应链视觉语言
   ============================================================ */
:root {
    --ink: #0b1f19;
    --ink-2: #13352a;
    --forest: #0f2e24;
    --forest-2: #164435;
    --leaf: #1d7a50;
    --leaf-2: #2b9966;
    --leaf-soft: #e8f3ec;
    --gold: #c7a04a;
    --gold-2: #e0bd6d;
    --gold-soft: #fbf3e2;
    --cream: #f5f2e9;
    --cream-2: #efeade;
    --paper: #fffdf8;
    --white: #ffffff;
    --line: #e6e0d2;
    --line-2: #d9d2c2;
    --text: #20312b;
    --muted: #6f7c74;
    --muted-2: #96a19a;
    --danger: #b8493a;
    --danger-soft: #fbeeeb;
    --warn: #c07b22;
    --warn-soft: #fdf5e6;
    --info: #2f6f8f;
    --info-soft: #edf5f9;
    --violet: #6a5a9e;
    --violet-soft: #f2effa;
    --shadow-sm: 0 1px 2px rgba(14, 40, 31, .05), 0 2px 8px rgba(14, 40, 31, .04);
    --shadow-md: 0 8px 26px rgba(14, 40, 31, .09), 0 1px 3px rgba(14, 40, 31, .06);
    --shadow-lg: 0 24px 60px rgba(9, 28, 22, .22), 0 4px 14px rgba(9, 28, 22, .1);
    --r-sm: 8px;
    --r: 12px;
    --r-lg: 18px;
    --r-xl: 24px;
    --sidebar: 250px;
    --topbar: 66px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
    --mono: "SFMono-Regular", "JetBrains Mono", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 14px;
    color: var(--text);
    background: var(--cream);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
::selection { background: rgba(29, 122, 80, .18); }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d3ccbb; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #bfb7a3; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 应用骨架 ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar);
    flex: 0 0 var(--sidebar);
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    display: flex;
    flex-direction: column;
    color: #dfe8e2;
    background:
        radial-gradient(1200px 600px at -20% -10%, rgba(64, 140, 104, .28), transparent 60%),
        radial-gradient(800px 500px at 110% 105%, rgba(199, 160, 74, .16), transparent 55%),
        linear-gradient(168deg, #0d2a21 0%, #0a231b 55%, #071a14 100%);
    border-right: 1px solid rgba(255, 255, 255, .06);
    box-shadow: 14px 0 40px rgba(7, 26, 20, .18);
}
.sidebar::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: .5;
    background-image:
        repeating-linear-gradient(115deg, rgba(255, 255, 255, .028) 0 1px, transparent 1px 26px),
        repeating-linear-gradient(25deg, rgba(255, 255, 255, .018) 0 1px, transparent 1px 34px);
    mask-image: linear-gradient(to bottom, #000 0 70%, transparent);
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 20px 18px;
    position: relative;
    z-index: 1;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.brand-mark {
    width: 42px; height: 42px;
    border-radius: 13px;
    display: grid; place-items: center;
    background: linear-gradient(150deg, #2c8a5e, #176046 70%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 6px 16px rgba(0, 0, 0, .28);
    color: #f3e7c8;
    flex: none;
}
.brand-mark svg { width: 24px; height: 24px; }
.brand-title { font-size: 15.5px; font-weight: 700; letter-spacing: .5px; color: #f3f0e4; line-height: 1.25; }
.brand-sub { font-size: 10.5px; color: #8fae9f; letter-spacing: 2.2px; text-transform: uppercase; margin-top: 3px; }

.side-scroll { flex: 1; overflow-y: auto; padding: 12px 10px 18px; position: relative; z-index: 1; }
.side-scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .13); }

.menu-group { margin-bottom: 4px; }
.menu-group-head {
    display: flex; align-items: center; gap: 9px;
    padding: 10px 10px;
    border-radius: 9px;
    color: #a9c4b7;
    font-size: 11.5px;
    letter-spacing: .6px;
    cursor: pointer;
    user-select: none;
    transition: .18s;
}
.menu-group-head:hover { background: rgba(255, 255, 255, .05); color: #e5eee8; }
.menu-group-head .ico { width: 15px; height: 15px; opacity: .85; }
.menu-group-head .caret { margin-left: auto; width: 13px; height: 13px; transition: transform .22s ease; opacity: .55; }
.menu-group.open .menu-group-head .caret { transform: rotate(90deg); }
.menu-group-head .count {
    font-size: 9.5px; padding: 1px 6px; border-radius: 20px;
    background: rgba(255, 255, 255, .07); color: #8fae9f; margin-left: auto;
}
.menu-group-head .caret + .count, .menu-group-head .count + .caret { margin-left: 4px; }
.menu-group-body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .26s ease;
}
.menu-group.open .menu-group-body { grid-template-rows: 1fr; }
.menu-group-body > div { overflow: hidden; }

.menu-item {
    display: flex; align-items: center; gap: 10px;
    margin: 2px 4px 2px 8px;
    padding: 9px 10px 9px 12px;
    border-radius: 9px;
    color: #b7cec2;
    font-size: 12.8px;
    position: relative;
    transition: .18s;
    white-space: nowrap;
}
.menu-item .ico { width: 15px; height: 15px; opacity: .72; flex: none; }
.menu-item:hover { background: rgba(255, 255, 255, .06); color: #f0f5f1; }
.menu-item.active {
    background: linear-gradient(90deg, rgba(56, 143, 100, .30), rgba(56, 143, 100, .12) 70%, transparent);
    color: #fff;
    font-weight: 600;
}
.menu-item.active::before {
    content: "";
    position: absolute; left: -4px; top: 9px; bottom: 9px; width: 3px;
    border-radius: 3px;
    background: linear-gradient(180deg, var(--gold-2), var(--gold));
    box-shadow: 0 0 10px rgba(224, 189, 109, .45);
}
.menu-item.active .ico { opacity: 1; color: var(--gold-2); }

.side-foot {
    padding: 12px 18px 16px;
    border-top: 1px solid rgba(255, 255, 255, .07);
    font-size: 10.5px;
    color: #78998a;
    display: flex; align-items: center; justify-content: space-between;
    position: relative; z-index: 1;
}
.side-foot .dot { width: 6px; height: 6px; border-radius: 50%; background: #4cc088; box-shadow: 0 0 0 3px rgba(76, 192, 136, .16); }

.main-wrap {
    margin-left: var(--sidebar);
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background:
        radial-gradient(1100px 460px at 88% -8%, rgba(199, 160, 74, .10), transparent 62%),
        radial-gradient(900px 500px at 4% 102%, rgba(29, 122, 80, .07), transparent 55%),
        var(--cream);
}

.topbar {
    height: var(--topbar);
    flex: 0 0 var(--topbar);
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 0 26px 0 28px;
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(245, 242, 233, .82);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(214, 206, 190, .7);
}
.crumb { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); min-width: 0; }
.crumb .group { color: var(--muted-2); }
.crumb .sep { width: 12px; height: 12px; opacity: .5; }
.crumb .current { color: var(--ink-2); font-weight: 600; font-size: 12.5px; }
.top-search {
    margin-left: auto;
    display: flex; align-items: center; gap: 8px;
    width: 250px; height: 36px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 253, 248, .8);
    color: var(--muted);
    transition: .18s;
}
.top-search:focus-within { border-color: #b9cdc0; background: #fff; box-shadow: 0 0 0 3px rgba(29, 122, 80, .07); }
.top-search input { border: 0; background: transparent; outline: none; width: 100%; font-size: 12.5px; }
.top-search .ico { width: 15px; height: 15px; }
.top-search kbd {
    font-family: var(--mono); font-size: 9.5px; color: #a8a294;
    border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 1px 4px;
}
.top-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
    width: 36px; height: 36px; display: grid; place-items: center;
    border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--muted);
    position: relative; transition: .18s;
}
.icon-btn:hover { background: #fff; border-color: var(--line); color: var(--leaf); }
.icon-btn .ico { width: 17px; height: 17px; }
.icon-btn .badge-dot {
    position: absolute; top: 7px; right: 7px; min-width: 15px; height: 15px; padding: 0 4px;
    border-radius: 9px; background: var(--danger); color: #fff; font-size: 9px; line-height: 15px;
    text-align: center; font-weight: 700; box-shadow: 0 0 0 2px var(--cream);
}
.user-chip {
    display: flex; align-items: center; gap: 9px;
    padding: 4px 8px 4px 4px; margin-left: 4px;
    border-radius: 30px; border: 1px solid transparent;
    transition: .18s; cursor: pointer;
}
.user-chip:hover { background: #fffdf8; border-color: var(--line); }
.avatar {
    width: 31px; height: 31px; border-radius: 50%;
    display: grid; place-items: center;
    color: #fff; font-size: 12px; font-weight: 700;
    background: linear-gradient(145deg, #2b9966, #136044);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3);
    flex: none;
}
.user-meta { line-height: 1.25; }
.user-meta b { display: block; font-size: 12px; color: var(--ink-2); font-weight: 600; }
.user-meta span { font-size: 10px; color: var(--muted-2); }
.user-menu {
    position: absolute; right: 22px; top: 58px; width: 190px;
    background: #fffdf8; border: 1px solid var(--line); border-radius: 12px;
    box-shadow: var(--shadow-md); padding: 6px; display: none; z-index: 80;
}
.user-menu.show { display: block; animation: pop .16s ease; }
.user-menu a, .user-menu button {
    display: flex; align-items: center; gap: 9px; width: 100%;
    padding: 9px 10px; border: 0; background: none; border-radius: 8px;
    font-size: 12.5px; color: var(--text); text-align: left;
}
.user-menu a:hover, .user-menu button:hover { background: var(--cream); color: var(--leaf); }
.user-menu .ico { width: 15px; height: 15px; }
.user-menu .u-head { padding: 8px 10px 10px; border-bottom: 1px dashed var(--line); margin-bottom: 5px; }
.user-menu .u-head b { font-size: 12.5px; display: block; }
.user-menu .u-head span { font-size: 10.5px; color: var(--muted-2); }

#page-root { flex: 1; padding: 26px 28px 44px; max-width: 1640px; width: 100%; margin: 0 auto; }
.page { animation: pageIn .34s cubic-bezier(.2, .7, .3, 1); }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- 页面头 ---------- */
.page-head { display: flex; align-items: flex-end; gap: 20px; margin-bottom: 20px; }
.page-head .ph-main { min-width: 0; }
.page-kicker {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 10.5px; letter-spacing: 1.6px; text-transform: uppercase;
    color: var(--leaf); font-weight: 700; margin-bottom: 7px;
}
.page-kicker::before { content: ""; width: 18px; height: 1.5px; background: var(--gold); display: inline-block; }
.page-title { font-size: 23px; font-weight: 750; letter-spacing: -.4px; color: var(--ink); line-height: 1.2; }
.page-sub { margin-top: 6px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.page-head .ph-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
.page-head .ph-tag {
    font-size: 10.5px; color: var(--warn); background: var(--gold-soft);
    border: 1px solid #efe0bd; padding: 4px 9px; border-radius: 6px; font-weight: 600;
}

/* ---------- 认证页 ---------- */
.auth-body {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    background: var(--cream);
}
.auth-art {
    position: relative;
    overflow: hidden;
    background: linear-gradient(160deg, #0b241b 0%, #123b2c 48%, #0a2018 100%);
    color: #e9e3d2;
    padding: 44px 54px;
    display: flex; flex-direction: column;
}
.auth-art::before {
    content: "";
    position: absolute; inset: 0;
    background:
        radial-gradient(700px 420px at 82% 8%, rgba(199, 160, 74, .2), transparent 60%),
        radial-gradient(800px 500px at 10% 100%, rgba(43, 153, 102, .25), transparent 60%),
        repeating-linear-gradient(115deg, rgba(255, 255, 255, .028) 0 1px, transparent 1px 30px);
}
.auth-art svg.ridges { position: absolute; inset: auto 0 0 0; width: 100%; height: 62%; opacity: .55; }
.auth-brand { position: relative; display: flex; align-items: center; gap: 13px; }
.auth-brand .brand-mark { width: 46px; height: 46px; }
.auth-brand b { font-size: 16px; letter-spacing: .4px; color: #f6f1e3; }
.auth-brand span { display: block; font-size: 10px; letter-spacing: 2.6px; color: #91b3a2; margin-top: 3px; }
.auth-copy { position: relative; margin-top: auto; max-width: 520px; }
.auth-copy h1 { font-size: 34px; line-height: 1.32; letter-spacing: -.5px; font-weight: 700; color: #f7f3e7; }
.auth-copy h1 em { font-style: normal; color: var(--gold-2); }
.auth-copy p { margin-top: 14px; color: #a9c3b6; font-size: 13px; line-height: 1.9; max-width: 440px; }
.auth-stats { position: relative; display: flex; gap: 34px; margin: 30px 0 8px; }
.auth-stats b { font-size: 24px; font-weight: 700; color: #f4eeda; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.auth-stats span { display: block; font-size: 10.5px; color: #8fb0a0; letter-spacing: 1px; margin-top: 4px; }
.auth-note { position: relative; font-size: 10.5px; color: #6e9080; display: flex; justify-content: space-between; margin-top: 26px; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px; }
.auth-card { width: 100%; max-width: 396px; }
.auth-card .a-kicker { font-size: 10.5px; letter-spacing: 2px; color: var(--gold); font-weight: 700; text-transform: uppercase; }
.auth-card h2 { font-size: 27px; font-weight: 750; letter-spacing: -.5px; margin: 10px 0 5px; color: var(--ink); }
.auth-card .a-sub { font-size: 12.5px; color: var(--muted); margin-bottom: 26px; }
.auth-field { margin-bottom: 15px; }
.auth-field label { display: block; font-size: 11.5px; font-weight: 600; color: #4c5c54; margin-bottom: 7px; letter-spacing: .3px; }
.auth-input {
    display: flex; align-items: center; gap: 9px;
    height: 44px; padding: 0 13px;
    background: #fffdf8; border: 1px solid var(--line); border-radius: 11px;
    transition: .18s;
}
.auth-input:focus-within { border-color: #8fb9a2; box-shadow: 0 0 0 3.5px rgba(29, 122, 80, .08); background: #fff; }
.auth-input .ico { width: 16px; height: 16px; color: #a8a294; }
.auth-input input { border: 0; outline: none; background: transparent; width: 100%; font-size: 13.5px; }
.auth-input .eye { border: 0; background: none; padding: 0; color: #a8a294; display: grid; place-items: center; }
.auth-row { display: flex; align-items: center; justify-content: space-between; margin: 2px 0 18px; font-size: 12px; }
.auth-row label { display: flex; align-items: center; gap: 7px; color: var(--muted); cursor: pointer; }
.auth-row a { color: var(--leaf); font-weight: 600; }
.auth-submit {
    width: 100%; height: 46px; border: 0; border-radius: 11px;
    background: linear-gradient(135deg, #1d7a50, #115c3e);
    color: #fff; font-size: 14px; font-weight: 600; letter-spacing: 1px;
    box-shadow: 0 10px 24px rgba(17, 92, 62, .24), inset 0 1px 0 rgba(255, 255, 255, .18);
    transition: .2s; position: relative;
}
.auth-submit:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(17, 92, 62, .3); }
.auth-submit:active { transform: none; }
.auth-submit:disabled { opacity: .7; cursor: default; }
.auth-foot { margin-top: 22px; font-size: 12px; color: var(--muted); text-align: center; }
.auth-foot a { color: var(--leaf); font-weight: 600; }
.auth-alert {
    display: none; margin-bottom: 14px; padding: 9px 12px; border-radius: 9px;
    background: var(--danger-soft); border: 1px solid #f0d3cd; color: var(--danger); font-size: 12px;
}
.auth-alert.show { display: block; animation: pop .2s ease; }
.auth-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.auth-tags span {
    font-size: 10px; color: #8a948d; border: 1px solid var(--line); border-radius: 20px;
    padding: 3px 9px; background: rgba(255, 253, 248, .6);
}
.pw-bars { display: flex; gap: 4px; margin-top: 7px; }
.pw-bars i { height: 3px; flex: 1; border-radius: 3px; background: #e6e0d2; transition: .2s; }
.pw-bars[data-level="1"] i:nth-child(1) { background: #b8493a; }
.pw-bars[data-level="2"] i:nth-child(-n+2) { background: #c07b22; }
.pw-bars[data-level="3"] i { background: #2b9966; }
.pw-hint { font-size: 10px; color: var(--muted-2); margin-top: 5px; }

@media (max-width: 1080px) {
    .auth-body { grid-template-columns: 1fr; }
    .auth-art { display: none; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 1280px) {
    #page-root { padding: 22px 20px 38px; }
    .top-search { width: 200px; }
}
@media (max-width: 980px) {
    :root { --sidebar: 74px; }
    .brand-title, .brand-sub, .menu-group-head span, .menu-item span, .side-foot { display: none; }
    .brand { justify-content: center; padding: 18px 0; }
    .menu-group-head { justify-content: center; }
    .menu-group-head .count, .menu-group-head .caret { display: none; }
    .menu-item { justify-content: center; padding: 11px 0; }
    .menu-item.active::before { display: none; }
    .top-search { display: none; }
    .user-meta { display: none; }
    #page-root { padding: 18px 16px 32px; }
}
