/* ==========================================================================
   客迹 · 客户跟进台
   纯 CSS，无外部字体与框架依赖。
   ========================================================================== */

:root {
    --bg: #f3efe6;
    --bg-deep: #ebe5d9;
    --surface: #fffdf9;
    --surface-2: #faf7f0;
    --surface-3: #f4efe4;
    --ink: #1d2c26;
    --ink-2: #3f5048;
    --muted: #75827a;
    --muted-2: #95a098;
    --line: #e6dfd2;
    --line-strong: #d7cdbb;
    --green: #1a6b56;
    --green-dark: #123f35;
    --green-deep: #0f352d;
    --green-soft: #e8f2ec;
    --green-mid: #2c8a72;
    --amber: #a96e16;
    --amber-soft: #faf0d8;
    --coral: #be5748;
    --coral-soft: #fbeae6;
    --blue: #3c6e8d;
    --blue-soft: #e9f1f6;
    --shadow-sm: 0 1px 2px rgba(31, 44, 37, .04), 0 4px 12px -6px rgba(31, 44, 37, .08);
    --shadow-md: 0 22px 50px -30px rgba(23, 47, 38, .35);
    --shadow-lg: 0 30px 80px -45px rgba(17, 40, 32, .45);
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 22px;
    --radius-xl: 30px;
    --font: "Inter", "SF Pro Text", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
    --font-display: "Noto Serif SC", "Songti SC", "STSong", Georgia, serif;
    --nav-width: 258px;
    --ease: cubic-bezier(.22, .8, .28, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.6;
    background:
        radial-gradient(1100px 600px at 88% -10%, rgba(201, 227, 210, .55), transparent 62%),
        radial-gradient(900px 600px at -8% 105%, rgba(238, 219, 181, .38), transparent 60%),
        var(--bg);
    -webkit-font-smoothing: antialiased;
}

body.app-body,
body.auth-body {
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
}

img,
svg {
    display: block;
}

h1,
h2,
h3,
h4,
p,
dl,
dd {
    margin: 0;
}

ul,
ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

.icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.muted {
    color: var(--muted-2);
}

:focus-visible {
    outline: 3px solid rgba(26, 107, 86, .32);
    outline-offset: 2px;
}

::selection {
    background: rgba(26, 107, 86, .18);
}

/* ==========================================================================
   品牌
   ========================================================================== */

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    letter-spacing: -.01em;
}

.brand-mark {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(145deg, #2b8a70, #155744);
    color: #f8f3e5;
    font-family: var(--font-display);
    font-size: 23px;
    font-weight: 800;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 8px 18px -10px rgba(15, 53, 45, .7);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    font-size: 18px;
}

.brand-text small {
    margin-top: 3px;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: .2em;
    color: var(--muted);
}

.brand-light {
    color: #f5f1e5;
}

.brand-light .brand-mark {
    background: #eff3df;
    color: #163e34;
    box-shadow: inset 0 1px 0 #fff, 0 8px 20px -12px #000;
}

.brand-light .brand-text small {
    color: rgba(235, 241, 234, .52);
}

.brand-compact {
    color: var(--ink);
    gap: 9px;
    font-size: 17px;
}

.brand-compact .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 18px;
}

.brand-compact .brand-text {
    font-size: 16px;
}

/* ==========================================================================
   按钮
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 11px;
    background: transparent;
    color: var(--ink);
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition: transform .18s var(--ease), background .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease), color .18s var(--ease);
}

.btn .icon {
    width: 17px;
    height: 17px;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(160deg, #217c63, #17604c);
    color: #fff;
    box-shadow: 0 8px 18px -12px rgba(16, 76, 61, .8), inset 0 1px 0 rgba(255, 255, 255, .12);
}

.btn-primary:hover {
    background: linear-gradient(160deg, #24876b, #155642);
    box-shadow: 0 12px 24px -14px rgba(16, 76, 61, .9), inset 0 1px 0 rgba(255, 255, 255, .12);
}

.btn-dark {
    background: var(--green-dark);
    color: #fff;
}

.btn-dark:hover {
    background: #0e332a;
}

.btn-ghost {
    border-color: var(--line);
    background: var(--surface);
    color: var(--ink-2);
}

.btn-ghost:hover {
    border-color: var(--line-strong);
    background: var(--surface-2);
}

.btn-danger-ghost {
    border-color: #ecd0ca;
    background: #fffaf8;
    color: var(--coral);
}

.btn-danger-ghost:hover {
    background: var(--coral-soft);
    border-color: #e3b7ae;
}

.btn-block {
    width: 100%;
}

.btn-lg {
    min-height: 50px;
    padding: 0 22px;
    border-radius: 13px;
    font-size: 14.5px;
}

.btn:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
}

.icon-btn {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface);
    color: var(--ink-2);
    transition: background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}

.icon-btn:hover {
    background: var(--green-soft);
    color: var(--green);
    border-color: #cfe1d6;
}

.icon-btn-dark {
    background: rgba(255, 255, 255, .06);
    border-color: rgba(255, 255, 255, .12);
    color: rgba(255, 255, 255, .66);
}

.icon-btn-dark:hover {
    background: rgba(255, 255, 255, .12);
    border-color: rgba(255, 255, 255, .2);
    color: #fff;
}

/* ==========================================================================
   登录 / 安装
   ========================================================================== */

.auth-body {
    background: #f3efe6;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
    min-height: 100vh;
}

.auth-aside {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: clamp(28px, 4vw, 56px);
    color: #f5f1e5;
    background:
        radial-gradient(720px 520px at 100% 0%, rgba(74, 145, 119, .36), transparent 64%),
        radial-gradient(560px 460px at 0% 100%, rgba(166, 134, 68, .18), transparent 60%),
        linear-gradient(155deg, #17483c 0%, #10352d 62%, #0c2b24 100%);
}

.auth-aside::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .32;
    background-image:
        linear-gradient(rgba(255, 255, 255, .055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .055) 1px, transparent 1px);
    background-size: 52px 52px;
    mask-image: radial-gradient(circle at 65% 35%, #000, transparent 74%);
    pointer-events: none;
}

.auth-aside::after {
    content: "";
    position: absolute;
    width: 360px;
    height: 360px;
    right: -150px;
    bottom: -170px;
    border-radius: 50%;
    border: 1px solid rgba(238, 241, 222, .16);
    box-shadow: 0 0 0 55px rgba(238, 241, 222, .035), 0 0 0 110px rgba(238, 241, 222, .025);
    pointer-events: none;
}

.auth-aside > * {
    position: relative;
    z-index: 1;
}

.auth-copy {
    margin-top: auto;
    padding-top: 72px;
    max-width: 540px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--green);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.eyebrow-light {
    color: #c9d9a4;
}

.auth-copy h1 {
    margin-top: 18px;
    font-family: var(--font-display);
    font-size: clamp(40px, 4.2vw, 62px);
    font-weight: 700;
    line-height: 1.16;
    letter-spacing: -.03em;
}

.auth-copy p {
    max-width: 430px;
    margin-top: 22px;
    color: rgba(237, 242, 231, .68);
    font-size: 14.5px;
    line-height: 1.9;
}

.auth-points {
    display: grid;
    gap: 16px;
    max-width: 470px;
    margin-top: 42px;
}

.auth-point {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding-top: 16px;
    border-top: 1px solid rgba(236, 242, 228, .13);
}

.auth-point-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 11px;
    background: rgba(238, 244, 221, .09);
    border: 1px solid rgba(238, 244, 221, .12);
    color: #dce7c4;
}

.auth-point strong {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: #f3f1e5;
}

.auth-point span {
    display: block;
    margin-top: 2px;
    color: rgba(234, 241, 229, .55);
    font-size: 12px;
}

.auth-footnote {
    margin-top: 44px;
    color: rgba(234, 241, 229, .38);
    font-size: 11px;
    letter-spacing: .12em;
}

.auth-main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px clamp(24px, 6vw, 84px);
    background:
        radial-gradient(600px 400px at 100% 0%, rgba(214, 233, 218, .42), transparent 60%),
        var(--bg);
}

.auth-main > .flash-stack {
    width: min(100%, 440px);
}

.auth-card {
    width: min(100%, 440px);
    padding: clamp(28px, 4vw, 42px);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.auth-card-wide {
    width: min(100%, 500px);
}

.auth-card h1 {
    margin-top: 14px;
    font-family: var(--font-display);
    font-size: clamp(28px, 3vw, 36px);
    line-height: 1.25;
    letter-spacing: -.02em;
}

.auth-sub {
    margin-top: 10px;
    color: var(--muted);
    font-size: 13.5px;
    line-height: 1.75;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 17px;
    margin-top: 28px;
}

.auth-form .btn-block {
    margin-top: 4px;
}

.auth-note {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.7;
}

.auth-note .icon {
    width: 15px;
    height: 15px;
    margin-top: 2px;
    color: var(--green-mid);
}

.auth-mobile-brand {
    display: none;
    align-items: center;
    gap: 10px;
    margin-bottom: 26px;
}

.auth-card-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    margin-bottom: 20px;
    border-radius: 17px;
    background: var(--green-soft);
    color: var(--green);
}

.auth-card-icon .icon {
    width: 26px;
    height: 26px;
}

.error-card {
    text-align: center;
}

.error-card .auth-card-icon {
    margin-inline: auto;
    background: var(--amber-soft);
    color: var(--amber);
}

.error-card .auth-sub {
    margin-bottom: 26px;
}

.setup-tip {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin: 20px 0;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 12px;
}

.setup-tip strong {
    color: var(--ink);
    font-size: 12.5px;
}

.setup-tip code {
    padding: 1px 5px;
    border-radius: 5px;
    background: #ece6da;
    color: var(--ink-2);
    font-size: 11px;
}

/* ==========================================================================
   应用框架
   ========================================================================== */

.app-shell {
    display: grid;
    grid-template-columns: var(--nav-width) minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 28px 18px 18px;
    color: #eaf0e6;
    background:
        radial-gradient(420px 280px at 0% 0%, rgba(92, 160, 132, .22), transparent 70%),
        linear-gradient(180deg, #16443a 0%, #10372f 58%, #0d2d27 100%);
    border-right: 1px solid rgba(255, 255, 255, .04);
    overflow-y: auto;
}

.sidebar::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .28;
    background-image: linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px);
    background-size: 100% 44px;
    pointer-events: none;
}

.sidebar > * {
    position: relative;
    z-index: 1;
}

.sidebar .brand {
    padding: 0 8px;
}

.side-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 38px;
}

.nav-label {
    margin: 18px 12px 7px;
    color: rgba(230, 239, 228, .4);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.nav-label:first-child {
    margin-top: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 43px;
    padding: 0 12px;
    border-radius: 11px;
    color: rgba(225, 235, 224, .72);
    font-size: 13.5px;
    font-weight: 500;
    transition: background .18s var(--ease), color .18s var(--ease), box-shadow .18s var(--ease);
}

.nav-item .icon {
    width: 17px;
    height: 17px;
    color: rgba(213, 229, 210, .58);
    transition: color .18s var(--ease);
}

.nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, .065);
}

.nav-item.is-active {
    color: #fff;
    background: rgba(238, 244, 222, .13);
    box-shadow: inset 0 0 0 1px rgba(238, 244, 222, .12);
}

.nav-item.is-active .icon {
    color: #d9e6b5;
}

.sidebar-foot {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid rgba(235, 242, 230, .11);
}

.side-user {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    padding: 7px;
    margin-left: -7px;
    border-radius: 12px;
    transition: background .18s var(--ease);
}

.side-user:hover {
    background: rgba(255, 255, 255, .06);
}

.side-user-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.side-user-text strong {
    overflow: hidden;
    color: #f2f5ea;
    font-size: 12.5px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.side-user-text small {
    overflow: hidden;
    color: rgba(226, 236, 224, .45);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logout-form {
    flex: 0 0 auto;
}

.main-wrap {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.main-content {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 34px clamp(20px, 3.4vw, 52px) 56px;
}

.mobile-header,
.mobile-nav {
    display: none;
}

/* ==========================================================================
   头像 / 标签
   ========================================================================== */

.avatar {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    border: 1px solid rgba(255, 255, 255, .4);
}

.avatar-sales {
    background: linear-gradient(145deg, #eaf2df, #d7e7cc);
    color: #356246;
}

.avatar-manager {
    background: linear-gradient(145deg, #f4e8ca, #edd9a7);
    color: #7b581b;
}

.avatar-sm {
    width: 34px;
    height: 34px;
    font-size: 12px;
}

.avatar-xs {
    width: 25px;
    height: 25px;
    font-size: 10px;
    border-width: 0;
}

.avatar-xl {
    width: 64px;
    height: 64px;
    font-size: 24px;
    border: 3px solid rgba(255, 255, 255, .65);
    box-shadow: 0 6px 18px -10px rgba(20, 55, 43, .5);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 24px;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    border: 1px solid transparent;
}

.badge .icon {
    width: 12px;
    height: 12px;
}

.badge-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
}

.badge-success {
    color: #1d7053;
    background: #e9f4ec;
    border-color: #d2e7d9;
}

.badge-danger {
    color: #a84f42;
    background: #fbebe7;
    border-color: #f0d5cf;
}

.badge-pending {
    color: #956718;
    background: #fbf1db;
    border-color: #eedfbe;
}

.badge-neutral {
    color: #6e7a72;
    background: #f2efe7;
    border-color: #e5dfd2;
}

.badge-lg {
    min-height: 28px;
    padding: 3px 12px;
    font-size: 11.5px;
}

.role-badge {
    min-height: 21px;
    padding: 1px 8px;
    font-size: 9.5px;
    font-weight: 600;
}

.role-badge .icon {
    width: 11px;
    height: 11px;
}

.role-manager {
    color: #7c5b20;
    background: #f8efd9;
    border-color: #ecdcb7;
}

.role-sales {
    color: #3a6557;
    background: #eaf2ec;
    border-color: #d7e7dd;
}

/* ==========================================================================
   列表内快捷状态
   ========================================================================== */

.quick-select-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.quick-select {
    min-width: 82px;
    height: 28px;
    padding: 0 25px 0 10px;
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--ink-2);
    font-size: 10.5px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: border-color .16s var(--ease), background .16s var(--ease), color .16s var(--ease), opacity .16s var(--ease);
}

.quick-select:hover {
    filter: brightness(.985);
}

.quick-select:focus-visible {
    outline: 3px solid rgba(26, 107, 86, .22);
    outline-offset: 2px;
}

.quick-select:disabled {
    opacity: .55;
    cursor: wait;
}

.quick-select.state-pending {
    color: #8f641b;
    background: #fbf1db;
    border-color: #ecdbb6;
}

.quick-select.state-yes {
    color: #1d7053;
    background: #e9f4ec;
    border-color: #d2e7d9;
}

.quick-select.state-no {
    color: #a84f42;
    background: #fbebe7;
    border-color: #f0d5cf;
}

.quick-select-chevron {
    position: absolute;
    top: 50%;
    right: 10px;
    width: 5px;
    height: 5px;
    border-right: 1.4px solid currentColor;
    border-bottom: 1.4px solid currentColor;
    color: #8b978f;
    transform: translateY(-70%) rotate(45deg);
    pointer-events: none;
}

.visit-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 27px;
    padding: 2px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color .16s var(--ease), background .16s var(--ease), color .16s var(--ease), opacity .16s var(--ease), transform .16s var(--ease);
}

.visit-dot {
    width: 6px;
    height: 6px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #b8c1ba;
    box-shadow: inset 0 0 0 1px rgba(84, 105, 92, .16);
    transition: background .16s var(--ease), box-shadow .16s var(--ease);
}

.visit-toggle:hover {
    border-color: #bdd3c5;
    background: var(--green-soft);
    color: var(--green);
    transform: translateY(-1px);
}

.visit-toggle.is-visited {
    border-color: #d2e7d9;
    background: #e9f4ec;
    color: #1d7053;
}

.visit-toggle.is-visited .visit-dot {
    background: #2d8b65;
    box-shadow: 0 0 0 3px rgba(45, 139, 101, .12);
}

.visit-toggle:disabled {
    opacity: .55;
    cursor: wait;
    transform: none;
}

.quick-toast {
    position: fixed;
    left: 50%;
    bottom: 26px;
    z-index: 1200;
    max-width: min(420px, calc(100vw - 32px));
    padding: 10px 16px;
    border: 1px solid #d2e7d9;
    border-radius: 999px;
    background: #143f35;
    box-shadow: 0 16px 34px -20px rgba(12, 43, 35, .65);
    color: #f3f5e9;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 10px);
    transition: opacity .22s var(--ease), transform .22s var(--ease);
}

.quick-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.quick-toast.is-error {
    border-color: #eccbc4;
    background: #8f3f34;
}

@media (max-width: 960px) {
    .quick-toast {
        bottom: calc(82px + env(safe-area-inset-bottom));
    }
}

/* ==========================================================================
   页头
   ========================================================================== */

.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 26px;
}

.page-head h1 {
    margin-top: 6px;
    font-family: var(--font-display);
    font-size: clamp(27px, 2.7vw, 36px);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -.025em;
}

.page-head p {
    margin-top: 7px;
    color: var(--muted);
    font-size: 13px;
}

.page-head p strong {
    color: var(--green);
    font-weight: 700;
}

.head-actions {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-shrink: 0;
    padding-top: 10px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    transition: color .18s var(--ease);
}

.back-link .icon {
    width: 14px;
    height: 14px;
}

.back-link:hover {
    color: var(--green);
}

.detail-heading {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 8px;
}

.detail-phone {
    font-family: var(--font-display);
    font-size: clamp(28px, 3vw, 40px);
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.15;
}

.detail-sub {
    margin-top: 5px;
    color: var(--muted);
    font-size: 12px;
}

.inline-form {
    display: inline-flex;
}

/* ==========================================================================
   统计卡片
   ========================================================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.stat-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-height: 122px;
    padding: 19px 17px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s var(--ease);
}

.stat-card::after {
    content: "";
    position: absolute;
    width: 90px;
    height: 90px;
    right: -42px;
    bottom: -50px;
    border-radius: 50%;
    background: rgba(26, 107, 86, .045);
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: #d8d1c2;
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 12px;
}

.stat-icon .icon {
    width: 19px;
    height: 19px;
}

.stat-icon-green {
    background: #e8f3ea;
    color: #2b7659;
}

.stat-icon-teal {
    background: #e4f2ee;
    color: #257a69;
}

.stat-icon-amber {
    background: #fbf1dc;
    color: #a67420;
}

.stat-icon-coral {
    background: #fbeae5;
    color: #b45b4a;
}

.stat-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.stat-label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.stat-value {
    margin: 2px 0 0;
    font-family: var(--font-display);
    font-size: 29px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -.02em;
}

.stat-hint {
    margin-top: 2px;
    color: var(--muted-2);
    font-size: 10.5px;
    white-space: nowrap;
}

.stat-arrow {
    position: absolute;
    top: 16px;
    right: 14px;
    color: var(--line-strong);
    opacity: .65;
    transition: transform .18s var(--ease), color .18s var(--ease);
}

.stat-arrow .icon {
    width: 14px;
    height: 14px;
}

.stat-card:hover .stat-arrow {
    color: var(--green);
    transform: translateX(2px);
}

.stat-card-accent {
    border-color: transparent;
    background:
        radial-gradient(180px 140px at 100% 0%, rgba(218, 233, 168, .18), transparent 70%),
        linear-gradient(150deg, #1c5b4b, #123e34);
    color: #f7f3e8;
}

.stat-card-accent .stat-label,
.stat-card-accent .stat-hint {
    color: rgba(240, 246, 234, .6);
}

.stat-card-accent .stat-icon {
    background: rgba(241, 247, 229, .12);
    color: #dbe9b8;
}

.stat-card-accent .stat-arrow {
    color: rgba(255, 255, 255, .34);
}

.stat-card-accent:hover {
    border-color: transparent;
}

.stat-card-accent:hover .stat-arrow {
    color: #fff;
}

/* ==========================================================================
   筛选
   ========================================================================== */

.filter-card {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.filter-primary {
    display: grid;
    grid-template-columns: minmax(230px, 1fr) 170px 170px auto auto;
    gap: 9px;
    align-items: center;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface-2);
    transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}

.search-box:focus-within {
    border-color: #b9d1c4;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(26, 107, 86, .08);
}

.search-box > .icon {
    width: 16px;
    height: 16px;
    margin-left: 14px;
    color: var(--muted-2);
}

.search-box input {
    width: 100%;
    height: 100%;
    padding: 0 14px 0 9px;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 13px;
}

.search-box input::placeholder {
    color: #a5aca5;
}

.select-wrap {
    position: relative;
    display: block;
}

.select-wrap select {
    width: 100%;
    height: 44px;
    padding: 0 34px 0 13px;
    appearance: none;
    border: 1px solid var(--line);
    border-radius: 11px;
    outline: 0;
    background: var(--surface-2);
    color: var(--ink-2);
    font-size: 12.5px;
    cursor: pointer;
    transition: border-color .18s var(--ease), background .18s var(--ease);
}

.select-wrap select:hover {
    background: #fff;
}

.select-wrap select:focus {
    border-color: #b9d1c4;
    box-shadow: 0 0 0 3px rgba(26, 107, 86, .08);
}

.select-wrap > .icon {
    position: absolute;
    top: 50%;
    right: 11px;
    width: 14px;
    height: 14px;
    color: var(--muted-2);
    transform: translateY(-50%);
    pointer-events: none;
}

.filter-advanced {
    margin-top: 10px;
    border-top: 1px dashed var(--line);
}

.filter-advanced summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 3px 4px;
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 500;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.filter-advanced summary::-webkit-details-marker {
    display: none;
}

.filter-advanced summary .icon {
    width: 14px;
    height: 14px;
}

.filter-advanced summary .icon:last-child {
    width: 12px;
    height: 12px;
    transition: transform .2s var(--ease);
}

.filter-advanced[open] summary .icon:last-child {
    transform: rotate(180deg);
}

.filter-advanced summary:hover {
    color: var(--green);
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    padding: 14px 2px 3px;
}

.field-compact {
    gap: 5px;
}

.field-compact .field-label {
    font-size: 10.5px;
}

.filter-advanced input[type="date"] {
    height: 44px;
}

/* ==========================================================================
   表单
   ========================================================================== */

.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

.field-label {
    display: flex;
    align-items: baseline;
    gap: 5px;
    color: var(--ink-2);
    font-size: 11.5px;
    font-weight: 600;
}

.field-label em {
    color: var(--coral);
    font-size: 9px;
    font-style: normal;
    font-weight: 500;
    letter-spacing: .04em;
}

.field-hint {
    color: var(--muted-2);
    font-size: 10.5px;
    line-height: 1.55;
}

.field-hint .icon {
    width: 12px;
    height: 12px;
    display: inline-block;
    margin-right: 3px;
    vertical-align: -2px;
}

.field-hint-warn {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 9px;
    background: var(--amber-soft);
    color: #8b641f;
}

.field-hint-warn .icon {
    margin-top: 2px;
    margin-right: 0;
}

.field-error {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--coral);
    font-size: 10.5px;
    line-height: 1.4;
}

.field-error .icon {
    width: 12px;
    height: 12px;
}

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 48px;
    padding-left: 13px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fff;
    transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}

.input-wrap:focus-within {
    border-color: #a9c8b8;
    box-shadow: 0 0 0 3px rgba(26, 107, 86, .08);
}

.input-wrap.has-error {
    border-color: #e2b3aa;
    background: #fffbfa;
}

.input-wrap > .icon {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    color: var(--muted-2);
}

.input-wrap input {
    width: 100%;
    height: 46px;
    padding: 0 12px 0 9px;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 13px;
    min-width: 0;
}

.input-wrap input[readonly],
.input-wrap input:disabled {
    color: var(--muted);
    cursor: not-allowed;
}

.input-wrap input::placeholder,
textarea::placeholder {
    color: #a7aea7;
}

.input-wrap input[type="date"] {
    padding-left: 9px;
}

.password-toggle {
    width: 39px;
    height: 39px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    margin-right: 4px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted-2);
    transition: color .18s var(--ease), background .18s var(--ease);
}

.password-toggle:hover,
.password-toggle.is-visible {
    color: var(--green);
    background: var(--green-soft);
}

.password-toggle .icon {
    width: 15px;
    height: 15px;
}

textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 11px;
    outline: 0;
    background: #fff;
    color: var(--ink);
    font-size: 13px;
    line-height: 1.7;
    resize: vertical;
    transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}

textarea:focus {
    border-color: #a9c8b8;
    box-shadow: 0 0 0 3px rgba(26, 107, 86, .08);
}

input[type="date"] {
    width: 100%;
    height: 46px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 11px;
    outline: 0;
    background: #fff;
    color: var(--ink-2);
    font-size: 13px;
    transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}

input[type="date"]:focus {
    border-color: #a9c8b8;
    box-shadow: 0 0 0 3px rgba(26, 107, 86, .08);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.form-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-grid-spaced {
    margin-top: 22px;
}

.choice-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.choice-row-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.choice {
    position: relative;
    display: block;
    cursor: pointer;
}

.choice input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.choice-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    height: 100%;
    min-height: 78px;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    transition: border-color .18s var(--ease), background .18s var(--ease), box-shadow .18s var(--ease), transform .18s var(--ease);
}

.choice:hover .choice-body {
    border-color: #ccd8cc;
    transform: translateY(-1px);
}

.choice input:checked + .choice-body {
    border-color: #86b7a2;
    background: linear-gradient(160deg, #edf6f0, #e5f1e9);
    box-shadow: inset 0 0 0 1px #a3cbb8;
}

.choice input:focus-visible + .choice-body {
    outline: 3px solid rgba(26, 107, 86, .25);
    outline-offset: 2px;
}

.choice-body strong {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    font-weight: 600;
}

.choice-body small {
    color: var(--muted);
    font-size: 10.5px;
    line-height: 1.45;
}

.choice-dot {
    width: 7px;
    height: 7px;
    display: inline-block;
    border-radius: 50%;
}

.choice-dot-pending {
    background: #c99a3d;
}

.choice-dot-success {
    background: #2d8b65;
}

.choice-dot-danger {
    background: #c05e4e;
}

.choice-icon {
    width: 27px;
    height: 27px;
    display: grid;
    place-items: center;
    margin-bottom: 5px;
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--green);
}

.choice-icon .icon {
    width: 15px;
    height: 15px;
}

.switch-row {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 46px;
    padding: 8px 13px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fff;
    cursor: pointer;
}

.switch-copy {
    display: flex;
    flex-direction: column;
}

.switch-copy strong {
    font-size: 12px;
    font-weight: 600;
}

.switch-copy small {
    color: var(--muted-2);
    font-size: 10px;
}

.switch-row input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.switch-track {
    width: 43px;
    height: 24px;
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    padding: 3px;
    border-radius: 999px;
    background: #d9d3c6;
    transition: background .2s var(--ease);
}

.switch-track span {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(30, 40, 33, .25);
    transition: transform .2s var(--ease);
}

.switch-row input:checked + .switch-track {
    background: var(--green);
}

.switch-row input:checked + .switch-track span {
    transform: translateX(19px);
}

.switch-row input:focus-visible + .switch-track {
    outline: 3px solid rgba(26, 107, 86, .25);
    outline-offset: 2px;
}

.switch-row input:disabled + .switch-track {
    opacity: .5;
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 4px 0 0;
}

.form-actions-inline {
    padding-top: 20px;
    border-top: 1px solid var(--line);
    margin-top: 20px;
}

.inline-alert {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 18px;
    padding: 12px 15px;
    border: 1px solid var(--line);
    border-radius: 11px;
    font-size: 12px;
    line-height: 1.6;
}

.inline-alert .icon {
    width: 16px;
    height: 16px;
}

.inline-alert-error {
    border-color: #efd4ce;
    background: #fdf1ee;
    color: #9d4d40;
}

.inline-alert-warn {
    border-color: #ecd9b3;
    background: #fdf6e7;
    color: #8b641f;
}

/* ==========================================================================
   客户列表
   ========================================================================== */

.records-section {
    min-width: 0;
}

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
    padding: 0 2px;
}

.section-head h2 {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -.01em;
}

.section-head p {
    margin-top: 2px;
    color: var(--muted);
    font-size: 11.5px;
}

.section-head p strong {
    color: var(--ink);
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--green-soft);
    color: var(--green);
    font-size: 10.5px;
    font-weight: 600;
}

.filter-chip .icon {
    width: 12px;
    height: 12px;
}

.quick-tip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #789181;
    font-weight: 500;
}

.quick-tip .icon {
    width: 11px;
    height: 11px;
}

.table-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.records-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 790px;
}

.records-table th {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    background: #faf7ef;
    color: var(--muted);
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: .06em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.records-table th:first-child {
    padding-left: 20px;
}

.records-table th:last-child {
    padding-right: 18px;
}

.records-table td {
    padding: 13px 14px;
    border-bottom: 1px solid #f0ebe1;
    color: var(--ink-2);
    font-size: 12px;
    vertical-align: middle;
}

.records-table td:first-child {
    padding-left: 20px;
}

.records-table td:last-child {
    padding-right: 18px;
}

.records-table tbody tr {
    transition: background .16s var(--ease);
}

.records-table tbody tr:hover {
    background: #fbf9f3;
}

.records-table tbody tr:last-child td {
    border-bottom: 0;
}

.th-action {
    width: 54px;
    text-align: right !important;
}

.td-action {
    text-align: right;
}

.customer-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-width: 280px;
}

.customer-main {
    color: var(--ink);
    font-size: 13.5px;
    font-weight: 650;
    letter-spacing: .01em;
    overflow-wrap: anywhere;
    transition: color .16s var(--ease);
}

.customer-cell:hover .customer-main {
    color: var(--green);
}

.customer-sub {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--muted);
    font-size: 10.5px;
    overflow-wrap: anywhere;
}

.customer-sub .icon {
    width: 11px;
    height: 11px;
    color: #8aa196;
}

.date-line {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--ink-2);
}

.date-line > .icon {
    width: 14px;
    height: 14px;
    color: var(--muted-2);
}

.date-line > span {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.date-line strong {
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}

.date-line small {
    color: var(--muted-2);
    font-size: 9.5px;
    white-space: nowrap;
}

.date-overdue strong,
.date-overdue > .icon {
    color: var(--coral);
}

.date-overdue small {
    color: #c18174;
}

.date-today strong {
    color: var(--green);
}

.date-today > .icon {
    color: var(--green-mid);
}

.date-done strong {
    color: var(--muted);
}

.date-done > .icon {
    color: #98b3a4;
}

.note-preview {
    display: flex;
    flex-direction: column;
    max-width: 260px;
    gap: 2px;
    color: var(--ink-2);
    font-size: 11px;
    line-height: 1.45;
}

.note-preview > span {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

.note-preview small {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: var(--muted-2);
    font-size: 9.5px;
}

.note-preview small .icon {
    width: 10px;
    height: 10px;
}

.note-preview:hover > span {
    color: var(--green);
}

.creator-cell {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ink-2);
    font-size: 11px;
    white-space: nowrap;
}

.row-action {
    width: 30px;
    height: 30px;
    display: inline-grid;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--muted-2);
    transition: color .16s var(--ease), background .16s var(--ease), border-color .16s var(--ease);
}

.row-action .icon {
    width: 14px;
    height: 14px;
}

.row-action:hover {
    color: var(--green);
    background: var(--green-soft);
    border-color: #d7e8dd;
}

.list-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 16px;
}

.list-summary {
    color: var(--muted);
    font-size: 10.5px;
}

/* 移动端卡片 */
.record-cards {
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
}

.record-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}

.record-card:hover {
    transform: translateY(-2px);
    border-color: #d6cfc0;
    box-shadow: var(--shadow-md);
}

.record-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.record-phone {
    flex: 1;
    min-width: 0;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: .01em;
    overflow-wrap: anywhere;
    transition: color .16s var(--ease);
}

.record-phone:hover {
    color: var(--green);
}

.record-card-wechat {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: -4px;
    color: var(--muted);
    font-size: 11px;
    overflow-wrap: anywhere;
}

.record-card-wechat .icon {
    width: 12px;
    height: 12px;
    color: #8aa196;
}

.record-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 0;
    border-top: 1px dashed var(--line);
    border-bottom: 1px dashed var(--line);
}

.record-card-note {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 9px 10px;
    border-radius: 9px;
    background: var(--surface-2);
    color: var(--ink-2);
    font-size: 10.5px;
    line-height: 1.6;
}

.record-card-note .icon {
    width: 12px;
    height: 12px;
    margin-top: 3px;
    color: var(--muted-2);
}

.record-card-note span {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.record-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.record-card-count {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: var(--muted-2);
    font-size: 9.5px;
}

.record-card-count .icon {
    width: 11px;
    height: 11px;
}

.record-card-open {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: var(--green);
    font-size: 9.5px;
    font-weight: 600;
    white-space: nowrap;
}

.record-card-open .icon {
    width: 11px;
    height: 11px;
    transition: transform .16s var(--ease);
}

.record-card-open:hover .icon {
    transform: translateX(2px);
}

/* ==========================================================================
   空状态
   ========================================================================== */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 330px;
    padding: 40px 24px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    background: rgba(255, 253, 248, .6);
    text-align: center;
}

.empty-icon {
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    margin-bottom: 16px;
    border-radius: 19px;
    background: var(--green-soft);
    color: var(--green);
    box-shadow: inset 0 0 0 1px #d7e7dd;
}

.empty-icon .icon {
    width: 26px;
    height: 26px;
}

.empty-state h3 {
    font-family: var(--font-display);
    font-size: 21px;
    font-weight: 700;
}

.empty-state p {
    max-width: 380px;
    margin: 7px 0 20px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.7;
}

/* ==========================================================================
   分页
   ========================================================================== */

.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
}

.page-btn {
    min-width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink-2);
    font-size: 11px;
    font-weight: 600;
    transition: background .16s var(--ease), color .16s var(--ease), border-color .16s var(--ease);
}

.page-btn:hover {
    border-color: #bdd3c5;
    background: var(--green-soft);
    color: var(--green);
}

.page-btn.is-current {
    border-color: var(--green);
    background: var(--green);
    color: #fff;
}

.page-btn.is-disabled {
    color: #c4c9c3;
    background: transparent;
    cursor: default;
}

.page-arrow .icon {
    width: 13px;
    height: 13px;
}

.pagination .page-arrow:first-child .icon {
    transform: rotate(180deg);
}

.page-gap {
    padding: 0 2px;
    color: var(--muted-2);
    font-size: 11px;
}

/* ==========================================================================
   详情页
   ========================================================================== */

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 318px;
    gap: 20px;
    align-items: start;
}

.detail-main,
.detail-side {
    min-width: 0;
}

.detail-side {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.panel {
    padding: 22px 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.detail-main > .panel {
    margin-bottom: 16px;
}

.detail-main > .panel:last-child {
    margin-bottom: 0;
}

.panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.panel-kicker {
    display: block;
    margin-bottom: 4px;
    color: var(--green);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.panel-head h2 {
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -.01em;
}

.panel-hint {
    color: var(--muted-2);
    font-size: 10px;
    white-space: normal;
    text-align: right;
    line-height: 1.5;
    padding-top: 4px;
}

.contact-error {
    margin-top: 10px;
}

.panel-soft {
    background: var(--surface-2);
    box-shadow: none;
}

.panel-tip {
    position: relative;
    overflow: hidden;
    border-color: transparent;
    background: linear-gradient(155deg, #1b5546, #123c32);
    color: #f2f3e8;
    box-shadow: var(--shadow-md);
}

.panel-tip::after {
    content: "";
    position: absolute;
    width: 150px;
    height: 150px;
    right: -70px;
    bottom: -80px;
    border-radius: 50%;
    border: 1px solid rgba(238, 244, 222, .16);
    box-shadow: 0 0 0 30px rgba(238, 244, 222, .04);
}

.tip-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    margin-bottom: 11px;
    border-radius: 10px;
    background: rgba(239, 245, 223, .1);
    color: #dce8b9;
}

.tip-icon .icon {
    width: 17px;
    height: 17px;
}

.panel-tip h3 {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 600;
}

.panel-tip p {
    margin-top: 8px;
    color: rgba(235, 243, 229, .62);
    font-size: 10.5px;
    line-height: 1.75;
}

.side-title {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 14px;
}

.side-title .icon {
    width: 15px;
    height: 15px;
    color: var(--green);
}

.side-title h3 {
    font-size: 12.5px;
    font-weight: 650;
}

.side-note {
    color: var(--muted);
    font-size: 10.5px;
    line-height: 1.65;
}

.side-person {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 14px;
    margin-bottom: 12px;
    border-bottom: 1px dashed var(--line);
}

.side-person div {
    display: flex;
    flex-direction: column;
}

.side-person strong {
    font-size: 12px;
    font-weight: 600;
}

.side-person span {
    color: var(--muted-2);
    font-size: 10px;
}

.meta-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.meta-list > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.meta-list dt {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 10.5px;
}

.meta-list dd {
    text-align: right;
    color: var(--ink-2);
    font-size: 10.5px;
    font-weight: 500;
}

.meta-list-roomy {
    gap: 13px;
}

.meta-list-roomy dt {
    font-size: 10.5px;
}

.meta-list-roomy dd {
    max-width: 68%;
    line-height: 1.5;
}

.meta-person {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.panel-divider {
    height: 1px;
    margin: 22px 0;
    background: var(--line);
}

.customer-hero {
    padding: 22px 24px;
    background:
        radial-gradient(360px 180px at 100% 0%, rgba(219, 235, 209, .45), transparent 70%),
        var(--surface);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.05fr 1fr 1fr;
    gap: 0;
}

.hero-item {
    min-width: 0;
    padding: 2px 22px;
    border-left: 1px solid var(--line);
}

.hero-item:first-child {
    padding-left: 0;
    border-left: 0;
}

.hero-label {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 500;
}

.hero-label .icon {
    width: 12px;
    height: 12px;
    color: var(--muted-2);
}

.hero-value {
    display: flex;
    flex-direction: column;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
    line-height: 1.35;
    word-break: break-word;
}

.hero-date {
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
}

.hero-date small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 400;
}

.hero-date.date-overdue {
    color: var(--coral);
}

.hero-date.date-today {
    color: var(--green);
}

.notes-head {
    margin-bottom: 15px;
}

.count-pill {
    display: inline-grid;
    place-items: center;
    min-width: 22px;
    height: 20px;
    padding: 0 7px;
    margin-left: 3px;
    border-radius: 999px;
    background: var(--green-soft);
    color: var(--green);
    font-family: var(--font);
    font-size: 10px;
    font-weight: 700;
    vertical-align: 2px;
}

.note-form {
    padding: 14px;
    margin-bottom: 22px;
    border: 1px dashed #d5cbb9;
    border-radius: 13px;
    background: var(--surface-2);
}

.note-form textarea {
    min-height: 84px;
    border-color: #e0d7c7;
    background: #fffdf8;
    font-size: 12.5px;
}

.note-form-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 9px;
}

.note-form-as {
    color: var(--muted-2);
    font-size: 10px;
}

.note-form-as strong {
    color: var(--ink-2);
}

.note-form .btn {
    min-height: 37px;
    padding: 0 14px;
    font-size: 12px;
}

.notes-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    padding: 32px 24px 20px;
    color: var(--muted);
    text-align: center;
}

.notes-empty .icon {
    width: 24px;
    height: 24px;
    color: #b9c4bc;
}

.notes-empty p {
    max-width: 340px;
    font-size: 10.5px;
    line-height: 1.7;
}

.timeline {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 17px;
}

.timeline::before {
    content: "";
    position: absolute;
    top: 18px;
    bottom: 10px;
    left: 18px;
    width: 1px;
    background: linear-gradient(#e1dacd, #f0ebe1);
}

.timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 11px;
}

.timeline-avatar {
    position: relative;
    z-index: 1;
    padding-top: 1px;
}

.timeline-card {
    padding: 12px 14px;
    border: 1px solid #ece5d8;
    border-radius: 12px;
    background: #fcfaf5;
}

.timeline-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 5px;
}

.timeline-author {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.timeline-author strong {
    font-size: 11.5px;
    font-weight: 650;
}

.timeline-head time {
    color: var(--muted-2);
    font-size: 9px;
    white-space: nowrap;
}

.latest-tag {
    padding: 0 5px;
    border-radius: 4px;
    background: #e9f2df;
    color: #59763d;
    font-size: 8px;
    font-weight: 600;
}

.timeline-content {
    color: var(--ink-2);
    font-size: 12px;
    line-height: 1.72;
    word-break: break-word;
}

.related-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-top: 10px;
}

.related-list a {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    transition: border-color .16s var(--ease), background .16s var(--ease);
}

.related-list a:hover {
    border-color: #bdd3c5;
    background: var(--green-soft);
}

.related-list strong {
    color: var(--ink);
    font-size: 11px;
}

.related-list span {
    color: var(--muted-2);
    font-size: 9.5px;
}

/* ==========================================================================
   账号
   ========================================================================== */

.permission-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 22px;
}

.permission-item {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.permission-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 9px;
}

.permission-icon .icon {
    width: 16px;
    height: 16px;
}

.permission-icon-sales {
    background: var(--green-soft);
    color: var(--green);
}

.permission-icon-manager {
    background: var(--amber-soft);
    color: var(--amber);
}

.permission-item strong {
    display: block;
    font-size: 11.5px;
    font-weight: 650;
}

.permission-item span {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.55;
}

.users-table {
    min-width: 760px;
}

.member-cell {
    display: flex;
    align-items: center;
    gap: 9px;
}

.member-cell > span {
    display: flex;
    flex-direction: column;
}

.member-cell strong {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--ink);
    font-size: 12px;
    font-weight: 600;
}

.member-cell small {
    color: var(--muted-2);
    font-size: 9.5px;
}

.me-tag {
    padding: 0 5px;
    border-radius: 4px;
    background: var(--green-soft);
    color: var(--green);
    font-size: 8px;
    font-style: normal;
    font-weight: 600;
}

.number-cell {
    display: flex;
    flex-direction: column;
    line-height: 1.35;
}

.number-cell strong {
    color: var(--ink);
    font-size: 12px;
}

.number-cell small {
    color: var(--muted-2);
    font-size: 9px;
}

.row-muted td {
    opacity: .62;
}

.user-cards {
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
}

.user-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.user-card.is-muted {
    opacity: .65;
}

.user-card-top {
    display: flex;
    align-items: center;
    gap: 9px;
}

.user-card-name {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.user-card-name strong {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12.5px;
}

.user-card-name span {
    color: var(--muted-2);
    font-size: 10px;
}

.user-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 9px;
    border-top: 1px dashed var(--line);
    color: var(--muted-2);
    font-size: 9.5px;
}

.profile-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 22px;
    margin-bottom: 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    background:
        radial-gradient(300px 180px at 100% 0%, rgba(222, 236, 210, .5), transparent 70%),
        linear-gradient(150deg, #f8f4e9, #fffdf8);
    box-shadow: var(--shadow-sm);
}

.profile-banner-text {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.profile-banner-text strong {
    font-family: var(--font-display);
    font-size: 21px;
    font-weight: 700;
}

.profile-banner-text span {
    color: var(--muted);
    font-size: 11px;
}

.permission-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.permission-list > div {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding-bottom: 9px;
    border-bottom: 1px dashed var(--line);
}

.permission-list > div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.permission-list strong {
    font-size: 11px;
    font-weight: 650;
}

.permission-list span {
    color: var(--muted);
    font-size: 10px;
}

/* ==========================================================================
   提示消息
   ========================================================================== */

.flash-stack {
    position: fixed;
    top: 20px;
    right: 22px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(380px, calc(100vw - 32px));
    pointer-events: none;
}

.flash {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 12px 13px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface);
    box-shadow: var(--shadow-md);
    color: var(--ink-2);
    font-size: 11.5px;
    line-height: 1.5;
    pointer-events: auto;
    animation: flash-in .32s var(--ease) both;
}

.flash.is-leaving {
    animation: flash-out .25s var(--ease) both;
}

.flash-icon {
    color: var(--green);
}

.flash-icon .icon {
    width: 16px;
    height: 16px;
}

.flash-success {
    border-left: 3px solid var(--green-mid);
}

.flash-error {
    border-left: 3px solid var(--coral);
}

.flash-error .flash-icon {
    color: var(--coral);
}

.flash-info {
    border-left: 3px solid var(--blue);
}

.flash-info .flash-icon {
    color: var(--blue);
}

.flash-text {
    flex: 1;
}

.flash-close {
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    margin: -2px -3px 0 0;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--muted-2);
}

.flash-close:hover {
    background: var(--surface-2);
    color: var(--ink);
}

.flash-close .icon {
    width: 12px;
    height: 12px;
}

@keyframes flash-in {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes flash-out {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-6px);
    }
}

/* ==========================================================================
   响应式
   ========================================================================== */

@media (max-width: 1240px) {
    :root {
        --nav-width: 240px;
    }

    .main-content {
        padding-inline: 27px;
    }

    .filter-primary {
        grid-template-columns: minmax(200px, 1fr) 155px 155px auto auto;
    }

    .note-preview {
        max-width: 210px;
    }

    .form-grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1120px) {
    .table-card {
        display: none;
    }

    .record-cards {
        display: grid;
    }

    .user-cards {
        display: grid;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stat-card {
        min-height: 108px;
    }

    .detail-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .detail-side {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }

    .detail-side .panel-tip {
        grid-column: 1 / -1;
    }

    .hero-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .hero-value {
        font-size: 17px;
    }
}

@media (max-width: 960px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

    .mobile-header {
        position: sticky;
        top: 0;
        z-index: 40;
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 62px;
        padding: 0 18px;
        border-bottom: 1px solid rgba(225, 218, 205, .8);
        background: rgba(247, 244, 236, .86);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
    }

    .mobile-header-actions {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .mobile-header .icon-btn {
        width: 36px;
        height: 36px;
        background: var(--surface);
    }

    .main-content {
        padding: 26px 22px calc(92px + env(safe-area-inset-bottom));
    }

    .mobile-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 50;
        display: flex;
        align-items: flex-end;
        justify-content: space-around;
        height: calc(66px + env(safe-area-inset-bottom));
        padding: 6px 10px env(safe-area-inset-bottom);
        border-top: 1px solid rgba(225, 218, 205, .9);
        background: rgba(255, 253, 248, .94);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        box-shadow: 0 -12px 30px -26px rgba(22, 53, 43, .5);
    }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        min-width: 64px;
        height: 52px;
        border-radius: 10px;
        color: var(--muted);
        font-size: 9.5px;
        font-weight: 500;
    }

    .mobile-nav-item .icon {
        width: 19px;
        height: 19px;
    }

    .mobile-nav-item.is-active {
        color: var(--green);
    }

    .mobile-nav-add {
        color: var(--green);
    }

    .mobile-add-circle {
        width: 42px;
        height: 42px;
        display: grid;
        place-items: center;
        margin-top: -22px;
        margin-bottom: 1px;
        border: 3px solid #f7f4ec;
        border-radius: 50%;
        background: var(--green);
        color: #fff;
        box-shadow: 0 8px 18px -9px rgba(16, 76, 61, .8);
    }

    .mobile-add-circle .icon {
        width: 19px;
        height: 19px;
    }

    .flash-stack {
        top: 72px;
        right: 16px;
    }

    .detail-layout {
        grid-template-columns: 1fr;
    }

    .detail-side {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }

    .detail-side .panel-tip {
        grid-column: 1 / -1;
    }

    .form-layout .detail-side {
        order: 2;
    }
}

@media (max-width: 780px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-aside {
        display: none;
    }

    .auth-main {
        justify-content: flex-start;
        padding: 34px 18px 48px;
        background:
            radial-gradient(700px 400px at 100% 0%, rgba(201, 227, 210, .55), transparent 60%),
            var(--bg);
    }

    .auth-mobile-brand {
        display: flex;
        width: min(100%, 440px);
    }

    .auth-card {
        padding: 26px 22px;
        border-radius: 22px;
    }

    .auth-card-wide {
        width: min(100%, 440px);
    }

    .auth-copy h1 {
        font-size: 38px;
    }

    .page-head {
        flex-direction: column;
        gap: 12px;
    }

    .head-actions {
        padding-top: 0;
    }

    .head-actions .btn {
        flex: 1;
    }

    .head-actions .inline-form {
        flex: 1;
    }

    .head-actions .inline-form .btn {
        width: 100%;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .stat-card {
        min-height: 102px;
        padding: 15px 13px;
        gap: 9px;
    }

    .stat-icon {
        width: 36px;
        height: 36px;
    }

    .stat-icon .icon {
        width: 17px;
        height: 17px;
    }

    .stat-value {
        font-size: 24px;
    }

    .stat-label {
        font-size: 10px;
    }

    .stat-hint {
        font-size: 9px;
    }

    .filter-primary {
        grid-template-columns: 1fr 1fr;
    }

    .filter-primary .search-box {
        grid-column: 1 / -1;
    }

    .filter-primary .btn {
        width: 100%;
    }

    .filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .record-cards {
        grid-template-columns: 1fr;
    }

    .record-card .quick-select {
        height: 32px;
        min-width: 86px;
        font-size: 11px;
    }

    .record-card .visit-toggle {
        min-height: 32px;
    }

    .list-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .pagination {
        justify-content: center;
    }

    .form-grid,
    .form-grid-3 {
        grid-template-columns: 1fr;
    }

    .choice-row-2 {
        grid-template-columns: 1fr;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .hero-item {
        padding: 10px 0 0;
        border-left: 0;
        border-top: 1px dashed var(--line);
    }

    .hero-item:first-child {
        padding-top: 0;
        border-top: 0;
    }

    .hero-value {
        font-size: 18px;
    }

    .detail-side {
        grid-template-columns: 1fr;
    }

    .permission-strip {
        grid-template-columns: 1fr;
    }

    .profile-banner {
        padding: 16px;
    }

    .profile-banner .role-badge {
        display: none;
    }

    .user-cards {
        display: grid;
        grid-template-columns: 1fr;
    }

    .users-table {
        display: none;
    }

    .note-form-foot {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .note-form .btn {
        width: 100%;
    }

    .form-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .form-actions .btn {
        width: 100%;
    }

    .form-actions-inline {
        flex-direction: row;
    }

    .form-actions-inline .btn {
        width: 100%;
    }
}

@media (max-width: 560px) {
    .main-content {
        padding: 20px 14px calc(90px + env(safe-area-inset-bottom));
    }

    .mobile-header {
        padding-inline: 14px;
    }

    .page-head h1 {
        font-size: 27px;
    }

    .detail-phone {
        font-size: 29px;
    }

    .page-head p {
        font-size: 12px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .stat-card {
        min-height: 96px;
        padding: 13px 11px;
    }

    .stat-icon {
        width: 32px;
        height: 32px;
        border-radius: 9px;
    }

    .stat-value {
        font-size: 22px;
    }

    .stat-arrow {
        display: none;
    }

    .filter-card {
        padding: 12px;
    }

    .filter-primary {
        grid-template-columns: 1fr;
    }

    .filter-primary .search-box {
        grid-column: auto;
    }

    .filter-grid {
        grid-template-columns: 1fr;
    }

    .choice-row {
        grid-template-columns: 1fr;
    }

    .choice-body {
        min-height: auto;
        padding: 11px 12px;
    }

    .choice-body small {
        display: none;
    }

    .panel {
        padding: 18px 16px;
        border-radius: 16px;
    }

    .customer-hero {
        padding: 18px 16px;
    }

    .detail-heading {
        gap: 6px;
    }

    .detail-heading .badge {
        min-height: 24px;
        font-size: 10px;
    }

    .timeline-item {
        grid-template-columns: 32px minmax(0, 1fr);
        gap: 9px;
    }

    .timeline::before {
        left: 15px;
    }

    .timeline-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .timeline-card {
        padding: 11px 12px;
    }

    .timeline-content {
        font-size: 11.5px;
    }

    .flash-stack {
        top: 70px;
        right: 10px;
        width: calc(100vw - 20px);
    }

    .pagination {
        gap: 3px;
    }

    .page-btn {
        min-width: 28px;
        height: 28px;
        padding: 0 6px;
    }

    .user-cards {
        gap: 9px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* ==========================================================================
   专业 CRM 视觉主题
   深海军蓝 + 企业蓝 + 中性灰，减少装饰性渐变与大圆角。
   ========================================================================== */

:root {
    --bg: #f4f6f9;
    --bg-deep: #edf0f4;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --surface-3: #f2f4f7;
    --ink: #101828;
    --ink-2: #344054;
    --muted: #667085;
    --muted-2: #98a2b3;
    --line: #e4e7ec;
    --line-strong: #d0d5dd;
    --green: #1d4ed8;
    --green-dark: #0f2a52;
    --green-deep: #0b1f33;
    --green-soft: #eef4ff;
    --green-mid: #2563eb;
    --amber: #b54708;
    --amber-soft: #fffaeb;
    --coral: #b42318;
    --coral-soft: #fef3f2;
    --blue: #175cd3;
    --blue-soft: #eff8ff;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04);
    --shadow-md: 0 8px 24px -18px rgba(16, 24, 40, .35);
    --shadow-lg: 0 24px 60px -32px rgba(16, 24, 40, .35);
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 12px;
    --radius-xl: 14px;
    --font-display: "Inter", "SF Pro Text", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
    --nav-width: 236px;
    --ease: cubic-bezier(.2, .7, .3, 1);
}

body {
    background: var(--bg);
    color: var(--ink);
}

body.app-body,
body.auth-body {
    background: var(--bg);
}

::selection {
    background: rgba(37, 99, 235, .16);
}

:focus-visible {
    outline: 3px solid rgba(37, 99, 235, .22);
    outline-offset: 2px;
}

/* 品牌 */
.brand {
    gap: 10px;
    letter-spacing: 0;
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: #1d4ed8;
    color: #ffffff;
    font-family: var(--font);
    font-size: 16px;
    font-weight: 700;
    box-shadow: none;
}

.brand-text {
    font-size: 14.5px;
    font-weight: 650;
    letter-spacing: -.01em;
}

.brand-text small {
    margin-top: 2px;
    font-size: 9px;
    font-weight: 500;
    letter-spacing: .08em;
    color: var(--muted);
}

.brand-light {
    color: #f8fafc;
}

.brand-light .brand-mark {
    background: #2563eb;
    color: #ffffff;
    box-shadow: none;
}

.brand-light .brand-text small {
    color: #8da2b8;
}

.brand-compact {
    color: var(--ink);
    gap: 8px;
    font-size: 14px;
}

.brand-compact .brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    font-size: 15px;
}

.brand-compact .brand-text {
    font-size: 14px;
}

/* 按钮 */
.btn {
    min-height: 38px;
    padding: 0 14px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
    transition: background .16s var(--ease), border-color .16s var(--ease), color .16s var(--ease), box-shadow .16s var(--ease);
}

.btn:hover {
    transform: none;
}

.btn-primary {
    background: #1d4ed8;
    color: #ffffff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .08);
}

.btn-primary:hover {
    background: #1844bf;
    box-shadow: 0 2px 5px rgba(16, 24, 40, .12);
}

.btn-dark {
    background: #0f2a52;
    color: #ffffff;
}

.btn-dark:hover {
    background: #0b1f3f;
}

.btn-ghost {
    border-color: var(--line-strong);
    background: var(--surface);
    color: var(--ink-2);
}

.btn-ghost:hover {
    border-color: #b8c1cd;
    background: var(--surface-2);
}

.btn-danger-ghost {
    border-color: #f1c7c2;
    background: #fffafa;
    color: var(--coral);
}

.btn-danger-ghost:hover {
    border-color: #e7a9a1;
    background: var(--coral-soft);
}

.btn-lg {
    min-height: 44px;
    padding: 0 18px;
    border-radius: 8px;
    font-size: 14px;
}

.icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 7px;
    border-color: var(--line);
    background: var(--surface);
    color: var(--ink-2);
}

.icon-btn:hover {
    background: var(--surface-2);
    color: #1d4ed8;
    border-color: var(--line-strong);
}

.icon-btn-dark {
    border-color: rgba(255, 255, 255, .1);
    background: transparent;
    color: #9eb0c3;
}

.icon-btn-dark:hover {
    border-color: rgba(255, 255, 255, .18);
    background: rgba(255, 255, 255, .07);
    color: #ffffff;
}

/* 应用框架 */
.app-shell {
    grid-template-columns: var(--nav-width) minmax(0, 1fr);
}

.sidebar {
    padding: 20px 14px 14px;
    background: #0b1f33;
    border-right: 0;
    overflow-y: auto;
}

.sidebar::before {
    display: none;
}

.sidebar .brand {
    padding: 2px 7px;
}

.side-nav {
    gap: 2px;
    margin-top: 30px;
}

.nav-label {
    margin: 16px 10px 6px;
    color: #8ca1b6;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: .11em;
}

.nav-item {
    min-height: 39px;
    gap: 10px;
    padding: 0 10px;
    border-radius: 6px;
    color: #c3cfdb;
    font-size: 13px;
    font-weight: 500;
}

.nav-item .icon {
    width: 17px;
    height: 17px;
    color: #8498ac;
}

.nav-item:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, .06);
}

.nav-item.is-active {
    color: #ffffff;
    background: #1d4ed8;
    box-shadow: none;
}

.nav-item.is-active .icon {
    color: #ffffff;
}

.sidebar-foot {
    gap: 6px;
    padding-top: 14px;
    border-top-color: rgba(255, 255, 255, .1);
}

.side-user {
    padding: 6px;
    border-radius: 6px;
}

.side-user-text strong {
    color: #f2f6fa;
    font-size: 12px;
}

.side-user-text small {
    color: #8498ac;
    font-size: 9.5px;
}

.main-content {
    max-width: 1480px;
    padding: 28px clamp(20px, 2.8vw, 40px) 48px;
}

/* 头像与标签 */
.avatar {
    border: 0;
    box-shadow: none;
    font-size: 12px;
}

.avatar-sales {
    background: #eaf1ff;
    color: #1d4ed8;
}

.avatar-manager {
    background: #fff4e5;
    color: #b54708;
}

.avatar-xs {
    width: 24px;
    height: 24px;
    font-size: 9px;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 11px;
}

.avatar-xl {
    width: 58px;
    height: 58px;
    font-size: 20px;
    border: 0;
    box-shadow: none;
}

.badge {
    min-height: 22px;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 10.5px;
    font-weight: 600;
}

.badge-lg {
    min-height: 26px;
    padding: 3px 9px;
    font-size: 11px;
}

.role-badge {
    border-radius: 4px;
    min-height: 20px;
    font-size: 9.5px;
}

.badge-success {
    color: #067647;
    background: #ecfdf3;
    border-color: #abefc6;
}

.badge-danger {
    color: #b42318;
    background: #fef3f2;
    border-color: #fecdca;
}

.badge-pending {
    color: #b54708;
    background: #fffaeb;
    border-color: #fedf89;
}

.badge-neutral {
    color: #475467;
    background: #f2f4f7;
    border-color: #e4e7ec;
}

.role-manager {
    color: #b54708;
    background: #fffaeb;
    border-color: #fedf89;
}

.role-sales {
    color: #175cd3;
    background: #eff8ff;
    border-color: #b2ddff;
}

/* 页头 */
.page-head {
    gap: 20px;
    margin-bottom: 20px;
}

.page-head h1 {
    margin-top: 4px;
    font-family: var(--font);
    font-size: clamp(23px, 2.2vw, 28px);
    font-weight: 650;
    line-height: 1.25;
    letter-spacing: -.02em;
}

.page-head p {
    margin-top: 5px;
    color: var(--muted);
    font-size: 12.5px;
}

.page-head p strong {
    color: #1d4ed8;
    font-weight: 650;
}

.eyebrow {
    color: #1d4ed8;
    font-size: 10px;
    font-weight: 650;
    letter-spacing: .08em;
    text-transform: none;
}

.head-actions {
    gap: 8px;
    padding-top: 8px;
}

.back-link {
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 11px;
}

.detail-phone {
    font-family: var(--font);
    font-size: clamp(24px, 2.6vw, 30px);
    font-weight: 650;
    letter-spacing: -.02em;
}

.detail-sub {
    margin-top: 4px;
    color: var(--muted);
    font-size: 11.5px;
}

/* 统计卡片 */
.stats-grid {
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    min-height: 92px;
    padding: 14px 15px;
    gap: 11px;
    border-radius: 10px;
    box-shadow: none;
    transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}

.stat-card::after {
    display: none;
}

.stat-card:hover {
    transform: none;
    border-color: #cbd5e1;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .06);
}

.stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

.stat-icon .icon {
    width: 17px;
    height: 17px;
}

.stat-icon-green {
    background: #eff4ff;
    color: #1d4ed8;
}

.stat-icon-teal {
    background: #ecfdf3;
    color: #067647;
}

.stat-icon-amber {
    background: #fffaeb;
    color: #b54708;
}

.stat-icon-coral {
    background: #f2f4f7;
    color: #344054;
}

.stat-label {
    color: var(--muted);
    font-size: 10.5px;
}

.stat-value {
    margin-top: 1px;
    font-family: var(--font);
    font-size: 24px;
    font-weight: 650;
    letter-spacing: -.02em;
}

.stat-hint {
    margin-top: 1px;
    color: var(--muted-2);
    font-size: 9.5px;
}

.stat-arrow {
    top: 13px;
    right: 12px;
    color: #b8c1cd;
}

.stat-card-accent {
    background: #0b1f33;
    border-color: #0b1f33;
    color: #ffffff;
}

.stat-card-accent .stat-icon {
    background: rgba(255, 255, 255, .1);
    color: #cfe0ff;
}

.stat-card-accent .stat-label,
.stat-card-accent .stat-hint {
    color: #9fb0c4;
}

.stat-card-accent:hover {
    border-color: #0b1f33;
    box-shadow: 0 2px 6px rgba(16, 24, 40, .14);
}

/* 筛选工具栏 */
.filter-card {
    padding: 12px;
    margin-bottom: 16px;
    border-radius: 10px;
    box-shadow: none;
}

.filter-primary {
    grid-template-columns: minmax(230px, 1fr) 160px 160px auto auto;
    gap: 8px;
}

.search-box {
    height: 40px;
    border-color: var(--line-strong);
    border-radius: 7px;
    background: var(--surface);
}

.search-box:focus-within {
    border-color: #84adff;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}

.search-box input {
    font-size: 12.5px;
}

.select-wrap select {
    height: 40px;
    border-color: var(--line-strong);
    border-radius: 7px;
    background: var(--surface);
    color: var(--ink-2);
    font-size: 12px;
}

.select-wrap select:hover {
    background: var(--surface-2);
}

.select-wrap select:focus {
    border-color: #84adff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}

.filter-advanced {
    margin-top: 8px;
    border-top-color: var(--line);
}

.filter-advanced summary {
    margin-top: 8px;
    color: var(--muted);
    font-size: 11px;
}

.filter-advanced summary:hover {
    color: #1d4ed8;
}

.filter-grid {
    gap: 10px;
    padding: 12px 2px 2px;
}

.field-label {
    color: var(--ink-2);
    font-size: 11.5px;
    font-weight: 550;
}

.field-hint {
    color: var(--muted-2);
    font-size: 10.5px;
}

/* 表单控件 */
.input-wrap {
    min-height: 44px;
    padding-left: 12px;
    border-color: var(--line-strong);
    border-radius: 7px;
    background: var(--surface);
}

.input-wrap:focus-within {
    border-color: #84adff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}

.input-wrap input {
    height: 42px;
    padding-left: 8px;
    font-size: 13px;
}

textarea {
    min-height: 96px;
    padding: 11px 12px;
    border-color: var(--line-strong);
    border-radius: 7px;
    font-size: 13px;
}

textarea:focus {
    border-color: #84adff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}

input[type="date"] {
    height: 42px;
    border-color: var(--line-strong);
    border-radius: 7px;
    font-size: 12.5px;
}

input[type="date"]:focus {
    border-color: #84adff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}

.form-grid {
    gap: 16px;
}

.form-grid-spaced {
    margin-top: 18px;
}

.choice-body {
    min-height: 72px;
    padding: 12px 13px;
    border-radius: 8px;
    background: var(--surface);
}

.choice:hover .choice-body {
    border-color: #b8c1cd;
    transform: none;
}

.choice input:checked + .choice-body {
    border-color: #1d4ed8;
    background: #eff4ff;
    box-shadow: inset 0 0 0 1px #1d4ed8;
}

.choice-icon {
    background: #eff4ff;
    color: #1d4ed8;
    border-radius: 6px;
}

.switch-row {
    min-height: 44px;
    padding: 8px 12px;
    border-color: var(--line-strong);
    border-radius: 7px;
}

.switch-track {
    background: #d0d5dd;
}

.switch-row input:checked + .switch-track {
    background: #1d4ed8;
}

.form-actions {
    gap: 8px;
}

.inline-alert {
    border-radius: 6px;
    font-size: 12px;
}

.contact-error {
    margin-top: 8px;
}

.field-error {
    color: var(--coral);
}

.inline-alert-error {
    border-color: #fecdca;
    background: #fef3f2;
    color: #912018;
}

.inline-alert-warn {
    border-color: #fedf89;
    background: #fffaeb;
    color: #b54708;
}

/* 记录列表 */
.section-head {
    margin-bottom: 10px;
}

.section-head h2 {
    font-family: var(--font);
    font-size: 16px;
    font-weight: 650;
}

.section-head p {
    font-size: 11px;
}

.filter-chip {
    border-radius: 4px;
    background: #eff8ff;
    color: #175cd3;
    font-size: 10px;
}

.quick-tip {
    color: var(--muted);
}

.quick-tip .icon {
    color: #1d4ed8;
}

.table-card {
    border-radius: 10px;
    box-shadow: none;
}

.records-table {
    min-width: 900px;
}

.records-table th {
    padding: 10px 14px;
    background: #f8fafc;
    color: #475467;
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: .04em;
}

.records-table td {
    padding: 11px 14px;
    border-bottom-color: #f2f4f7;
    font-size: 12px;
}

.records-table tbody tr:hover {
    background: #f9fafb;
}

.customer-main {
    color: var(--ink);
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.customer-sub {
    color: var(--muted);
    font-size: 10.5px;
}

.date-line strong {
    font-size: 11px;
}

.date-line small {
    font-size: 9px;
}

.note-preview > span {
    font-size: 11px;
}

.creator-cell {
    font-size: 10.5px;
}

.row-action {
    width: 28px;
    height: 28px;
    border-radius: 6px;
}

.row-action:hover {
    background: #eff4ff;
    border-color: #b2ddff;
    color: #1d4ed8;
}

.list-summary {
    font-size: 10.5px;
}

/* 快捷状态 */
.quick-select {
    min-width: 78px;
    height: 26px;
    padding: 0 23px 0 9px;
    border-radius: 4px;
    font-size: 10px;
}

.quick-select.state-pending {
    color: #b54708;
    background: #fffaeb;
    border-color: #fedf89;
}

.quick-select.state-yes {
    color: #067647;
    background: #ecfdf3;
    border-color: #abefc6;
}

.quick-select.state-no {
    color: #b42318;
    background: #fef3f2;
    border-color: #fecdca;
}

.quick-select-chevron {
    color: #667085;
}

.visit-toggle {
    min-height: 26px;
    padding: 2px 8px;
    border-radius: 4px;
    border-color: var(--line);
    background: var(--surface);
    color: #667085;
    font-size: 10px;
    font-weight: 600;
}

.visit-toggle:hover {
    border-color: #b2ddff;
    background: #eff8ff;
    color: #175cd3;
    transform: none;
}

.visit-toggle.is-visited {
    border-color: #abefc6;
    background: #ecfdf3;
    color: #067647;
}

.visit-toggle.is-visited .visit-dot {
    background: #12b76a;
    box-shadow: none;
}

/* 移动记录卡片 */
.record-card {
    padding: 14px;
    gap: 9px;
    border-radius: 10px;
    box-shadow: none;
}

.record-card:hover {
    transform: none;
    border-color: #cbd5e1;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .06);
}

.record-phone {
    font-size: 16px;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}

.record-card-wechat {
    color: var(--muted);
    font-size: 10.5px;
}

.record-card-meta {
    border-color: #f2f4f7;
}

.record-card-note {
    border-radius: 6px;
    background: var(--surface-2);
    font-size: 10.5px;
}

.record-card-open {
    color: #175cd3;
    font-size: 10px;
}

.empty-state {
    min-height: 300px;
    border: 1px dashed var(--line-strong);
    border-radius: 10px;
    background: var(--surface);
}

.empty-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    border-radius: 10px;
    background: #eff4ff;
    color: #1d4ed8;
    box-shadow: none;
}

.empty-icon .icon {
    width: 22px;
    height: 22px;
}

.empty-state h3 {
    font-family: var(--font);
    font-size: 18px;
    font-weight: 650;
}

.empty-state p {
    font-size: 11.5px;
}

/* 分页 */
.page-btn {
    min-width: 28px;
    height: 28px;
    border-radius: 6px;
    font-size: 10.5px;
}

.page-btn.is-current {
    border-color: #1d4ed8;
    background: #1d4ed8;
}

/* 详情 */
.detail-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 16px;
}

.panel {
    padding: 20px;
    border-radius: 10px;
    box-shadow: none;
}

.detail-main > .panel {
    margin-bottom: 14px;
}

.panel-head {
    margin-bottom: 14px;
}

.panel-kicker {
    margin-bottom: 2px;
    color: #1d4ed8;
    font-size: 9px;
    letter-spacing: .08em;
}

.panel-head h2 {
    font-family: var(--font);
    font-size: 17px;
    font-weight: 650;
}

.panel-hint {
    color: var(--muted-2);
    font-size: 9.5px;
}

.panel-soft {
    background: var(--surface-2);
}

.panel-tip {
    border-color: #d1e9ff;
    background: #f5faff;
    color: var(--ink);
    box-shadow: none;
}

.panel-tip::after {
    display: none;
}

.tip-icon {
    width: 30px;
    height: 30px;
    margin-bottom: 9px;
    border-radius: 6px;
    background: #e0f2fe;
    color: #175cd3;
}

.panel-tip h3 {
    font-family: var(--font);
    font-size: 13px;
    font-weight: 650;
}

.panel-tip p {
    color: var(--muted);
    font-size: 10.5px;
}

.customer-hero {
    padding: 20px;
    background: var(--surface);
}

.hero-item {
    padding: 2px 20px;
}

.hero-label {
    color: var(--muted);
    font-size: 9.5px;
}

.hero-value {
    font-family: var(--font);
    font-size: 16px;
    font-weight: 600;
}

.hero-date {
    font-size: 13px;
}

.notes-head {
    margin-bottom: 12px;
}

.count-pill {
    height: 18px;
    min-width: 20px;
    background: #eff4ff;
    color: #1d4ed8;
    font-size: 9.5px;
}

.note-form {
    padding: 12px;
    margin-bottom: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-2);
}

.note-form textarea {
    min-height: 78px;
    border-color: var(--line);
    background: var(--surface);
    font-size: 12px;
}

.note-form-as {
    font-size: 9.5px;
}

.note-form .btn {
    min-height: 34px;
    font-size: 11.5px;
}

.notes-empty {
    padding: 24px 20px 12px;
}

.notes-empty p {
    font-size: 10.5px;
}

.timeline {
    gap: 13px;
}

.timeline::before {
    top: 16px;
    left: 16px;
    background: var(--line);
}

.timeline-item {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 9px;
}

.timeline-avatar .avatar {
    width: 32px;
    height: 32px;
    font-size: 10px;
}

.timeline-card {
    padding: 10px 12px;
    border-color: var(--line);
    border-radius: 8px;
    background: var(--surface-2);
}

.timeline-author strong {
    font-size: 11px;
}

.timeline-head time {
    font-size: 8.5px;
}

.timeline-content {
    font-size: 11.5px;
}

.latest-tag {
    background: #eff4ff;
    color: #175cd3;
}

.side-title {
    margin-bottom: 12px;
}

.side-title h3 {
    font-size: 12px;
}

.meta-list-roomy {
    gap: 11px;
}

.meta-list dt,
.meta-list dd {
    font-size: 10px;
}

.related-list a {
    border-radius: 6px;
}

.profile-banner {
    padding: 18px;
    margin-bottom: 14px;
    border-color: var(--line);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: none;
}

.profile-banner-text strong {
    font-family: var(--font);
    font-size: 18px;
}

/* 账号管理 */
.permission-strip {
    gap: 10px;
    margin-bottom: 16px;
}

.permission-item {
    padding: 12px 14px;
    border-radius: 10px;
}

.permission-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
}

.permission-icon-sales {
    background: #eff8ff;
    color: #175cd3;
}

.permission-icon-manager {
    background: #fffaeb;
    color: #b54708;
}

.user-card {
    padding: 14px;
    border-radius: 10px;
    box-shadow: none;
}

.me-tag {
    border-radius: 3px;
    background: #eff4ff;
    color: #175cd3;
}

.member-cell strong {
    font-size: 11.5px;
}

.number-cell strong {
    font-size: 11.5px;
}

/* 公共消息 */
.flash {
    border-radius: 6px;
    border-left-width: 3px;
    box-shadow: 0 4px 12px -6px rgba(16, 24, 40, .18);
    font-size: 11.5px;
}

.flash-success {
    border-left-color: #12b76a;
}

.flash-success .flash-icon {
    color: #067647;
}

.flash-error {
    border-left-color: #f04438;
}

.flash-info {
    border-left-color: #2e90fa;
}

.quick-toast {
    bottom: 24px;
    padding: 9px 14px;
    border-radius: 6px;
    border-color: #1d4ed8;
    background: #0f2a52;
    box-shadow: 0 12px 24px -16px rgba(16, 24, 40, .4);
    font-size: 11.5px;
}

.quick-toast.is-error {
    border-color: #fecdca;
    background: #912018;
}

/* 登录页 */
.auth-shell {
    grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
}

.auth-aside {
    padding: clamp(30px, 4vw, 54px);
    background: #0b1f33;
    color: #f8fafc;
}

.auth-aside::before,
.auth-aside::after {
    display: none;
}

.auth-copy {
    max-width: 460px;
    margin-top: 0;
    padding-top: clamp(64px, 12vh, 130px);
}

.eyebrow-light {
    color: #84adff;
}

.auth-copy h1 {
    margin-top: 14px;
    color: #ffffff;
    font-family: var(--font);
    font-size: clamp(30px, 3.2vw, 38px);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -.025em;
}

.auth-copy p {
    max-width: 400px;
    margin-top: 16px;
    color: #9fb0c4;
    font-size: 13.5px;
    line-height: 1.8;
}

.auth-points {
    gap: 14px;
    max-width: 430px;
    margin-top: 34px;
}

.auth-point {
    gap: 12px;
    padding-top: 14px;
    border-top-color: rgba(255, 255, 255, .1);
}

.auth-point-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: rgba(37, 99, 235, .15);
    border-color: rgba(132, 173, 255, .2);
    color: #84adff;
}

.auth-point strong {
    color: #f2f6fa;
    font-size: 12.5px;
    font-weight: 600;
}

.auth-point span {
    color: #8da2b8;
    font-size: 11.5px;
}

.auth-footnote {
    margin-top: auto;
    padding-top: 40px;
    color: #879bb0;
    font-size: 10px;
    letter-spacing: .04em;
}

.auth-main {
    padding: 36px clamp(24px, 6vw, 80px);
    background: #f4f6f9;
}

.auth-card {
    width: min(100%, 420px);
    padding: clamp(26px, 3.6vw, 36px);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .06);
}

.auth-card h1 {
    margin-top: 10px;
    font-family: var(--font);
    font-size: 26px;
    font-weight: 650;
    letter-spacing: -.02em;
}

.auth-sub {
    margin-top: 7px;
    color: var(--muted);
    font-size: 12.5px;
}

.auth-form {
    gap: 15px;
    margin-top: 24px;
}

.auth-note {
    margin-top: 20px;
    padding-top: 16px;
    color: var(--muted);
    font-size: 10.5px;
}

.auth-mobile-brand {
    width: min(100%, 420px);
}

.auth-mobile-brand .brand-text small {
    display: block;
}

/* 响应式覆盖 */
@media (max-width: 1120px) {
    .stat-card {
        min-height: 86px;
    }

    .detail-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .detail-side {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }

    .detail-side .panel-tip {
        grid-column: 1 / -1;
    }
}

@media (max-width: 960px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .main-content {
        padding: 22px 20px calc(88px + env(safe-area-inset-bottom));
    }

    .mobile-header {
        height: 56px;
        padding: 0 16px;
        background: rgba(255, 255, 255, .96);
        border-bottom-color: var(--line);
        box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
    }

    .mobile-nav {
        height: calc(62px + env(safe-area-inset-bottom));
        padding-top: 5px;
        background: rgba(255, 255, 255, .97);
        border-top-color: var(--line);
        box-shadow: 0 -4px 12px -10px rgba(16, 24, 40, .3);
    }

    .mobile-nav-item {
        height: 48px;
        color: var(--muted);
        font-size: 9px;
    }

    .mobile-nav-item.is-active {
        color: #1d4ed8;
    }

    .mobile-nav-add {
        color: #1d4ed8;
    }

    .mobile-add-circle {
        border-color: #ffffff;
        background: #1d4ed8;
        box-shadow: 0 4px 10px -5px rgba(29, 78, 216, .7);
    }

    .quick-toast {
        bottom: calc(78px + env(safe-area-inset-bottom));
    }
}

@media (max-width: 1024px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-aside {
        display: none;
    }

    .auth-main {
        justify-content: center;
        padding: 32px 24px 48px;
        background: #f4f6f9;
    }

    .auth-mobile-brand {
        display: flex;
        width: min(100%, 420px);
    }
}

@media (max-width: 780px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-main {
        background: #f4f6f9;
    }

    .record-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .auth-card {
        padding: 24px 20px;
        border-radius: 12px;
    }

    .auth-mobile-brand {
        margin-bottom: 20px;
    }

    .auth-copy h1 {
        font-size: 32px;
    }

    .filter-primary {
        grid-template-columns: 1fr 1fr;
    }

    .record-card .quick-select {
        height: 30px;
        min-width: 82px;
    }

    .record-card .visit-toggle {
        min-height: 30px;
    }

    .detail-side {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .record-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .main-content {
        padding: 18px 14px calc(86px + env(safe-area-inset-bottom));
    }

    .mobile-header {
        padding-inline: 14px;
    }

    .page-head {
        margin-bottom: 16px;
    }

    .page-head h1 {
        font-size: 23px;
    }

    .stat-card {
        min-height: 82px;
        padding: 12px 11px;
    }

    .stat-icon {
        width: 32px;
        height: 32px;
    }

    .stat-value {
        font-size: 21px;
    }

    .panel {
        padding: 16px;
    }

    .customer-hero {
        padding: 16px;
    }

    .detail-phone {
        font-size: 24px;
    }

    .filter-card {
        padding: 10px;
    }

    .quick-toast {
        bottom: calc(76px + env(safe-area-inset-bottom));
    }
}

/* ==========================================================================
   顶部导航 + 放大字号
   ========================================================================== */

body {
    font-size: 15px;
    line-height: 1.6;
}

.app-shell {
    display: block;
    min-height: 100vh;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 60;
    background: rgba(255, 255, 255, .97);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.app-header-inner {
    width: 100%;
    max-width: 1480px;
    height: 66px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    align-items: center;
    gap: 26px;
}

.app-brand {
    flex: 0 0 auto;
    color: var(--ink);
}

.app-brand .brand-mark {
    width: 34px;
    height: 34px;
    font-size: 16px;
}

.app-brand .brand-text {
    font-size: 15px;
}

.app-brand .brand-text small {
    font-size: 9.5px;
    color: var(--muted);
}

.top-nav {
    display: flex;
    align-items: center;
    gap: 3px;
    align-self: stretch;
}

.top-nav-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 40px;
    padding: 0 12px;
    border-radius: 6px;
    color: #475467;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: background .16s var(--ease), color .16s var(--ease);
}

.top-nav-item .icon {
    width: 16px;
    height: 16px;
    color: #8498ac;
}

.top-nav-item:hover {
    color: var(--ink);
    background: var(--surface-2);
}

.top-nav-item.is-active {
    color: #1d4ed8;
    background: #eff4ff;
    font-weight: 600;
}

.top-nav-item.is-active .icon {
    color: #1d4ed8;
}

.header-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px 4px 4px;
    border-radius: 8px;
    transition: background .16s var(--ease);
}

.header-user:hover {
    background: var(--surface-2);
}

.header-user-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.header-user-text strong {
    color: var(--ink);
    font-size: 13px;
    font-weight: 600;
}

.header-user-text small {
    color: var(--muted);
    font-size: 9.5px;
}

.header-logout {
    color: var(--muted);
    background: transparent;
    border-color: transparent;
}

.header-logout:hover {
    color: var(--coral);
    background: var(--coral-soft);
    border-color: #fecdca;
}

.main-wrap {
    width: 100%;
}

.main-content {
    max-width: 1480px;
    padding: 30px 32px 56px;
}

/* 字体放大 */
.page-head {
    margin-bottom: 22px;
}

.page-head h1 {
    font-size: clamp(27px, 2.4vw, 32px);
}

.page-head p {
    margin-top: 6px;
    font-size: 14px;
}

.eyebrow {
    font-size: 11px;
}

.btn {
    min-height: 40px;
    padding: 0 16px;
    font-size: 14px;
}

.btn-lg {
    min-height: 46px;
    font-size: 15px;
}

.icon-btn {
    width: 36px;
    height: 36px;
}

.stat-card {
    min-height: 96px;
    padding: 15px 16px;
}

.stat-label {
    font-size: 12px;
}

.stat-value {
    font-size: 27px;
}

.stat-hint {
    font-size: 10.5px;
}

.stat-icon {
    width: 38px;
    height: 38px;
}

.section-head h2 {
    font-size: 18px;
}

.section-head p {
    font-size: 12px;
}

.filter-card {
    padding: 13px;
}

.search-box {
    height: 42px;
}

.search-box input {
    font-size: 14px;
}

.select-wrap select {
    height: 42px;
    font-size: 13.5px;
}

.filter-advanced summary {
    font-size: 12px;
}

.field-label {
    font-size: 12.5px;
}

.field-hint {
    font-size: 11px;
}

.input-wrap {
    min-height: 46px;
}

.input-wrap input {
    height: 44px;
    font-size: 14px;
}

textarea {
    font-size: 14px;
}

input[type="date"] {
    height: 44px;
    font-size: 13.5px;
}

.records-table th {
    padding: 11px 16px;
    font-size: 10.5px;
}

.records-table td {
    padding: 12px 16px;
    font-size: 13px;
}

.customer-main {
    font-size: 14px;
}

.customer-sub {
    font-size: 11.5px;
}

.date-line strong {
    font-size: 12px;
}

.date-line small {
    font-size: 10px;
}

.note-preview > span {
    font-size: 12px;
}

.note-preview small {
    font-size: 10px;
}

.creator-cell {
    font-size: 11.5px;
}

.quick-select {
    min-width: 84px;
    height: 28px;
    padding: 0 24px 0 10px;
    font-size: 11px;
}

.visit-toggle {
    min-height: 28px;
    padding: 2px 9px;
    font-size: 11px;
}

.badge {
    min-height: 23px;
    padding: 2px 8px;
    font-size: 11px;
}

.role-badge {
    min-height: 21px;
    font-size: 10px;
}

.list-summary {
    font-size: 11.5px;
}

.page-btn {
    min-width: 30px;
    height: 30px;
    font-size: 11.5px;
}

.record-card {
    padding: 16px;
}

.record-phone {
    font-size: 18px;
}

.record-card-wechat {
    font-size: 12px;
}

.record-card-note {
    font-size: 11.5px;
}

.record-card-open {
    font-size: 11px;
}

.empty-state h3 {
    font-size: 20px;
}

.empty-state p {
    font-size: 12.5px;
}

.detail-phone {
    font-size: clamp(28px, 2.8vw, 34px);
}

.detail-sub {
    font-size: 12.5px;
}

.panel {
    padding: 22px;
}

.panel-head h2 {
    font-size: 19px;
}

.panel-kicker {
    font-size: 10px;
}

.panel-hint {
    font-size: 10.5px;
}

.hero-label {
    font-size: 11px;
}

.hero-value {
    font-size: 18px;
}

.hero-date {
    font-size: 14px;
}

.panel-tip h3 {
    font-size: 14px;
}

.panel-tip p {
    font-size: 11.5px;
}

.side-title h3 {
    font-size: 13px;
}

.side-note {
    font-size: 11.5px;
}

.meta-list dt,
.meta-list dd {
    font-size: 11px;
}

.note-form textarea {
    font-size: 13.5px;
}

.note-form-as {
    font-size: 10.5px;
}

.timeline-author strong {
    font-size: 12px;
}

.timeline-head time {
    font-size: 9.5px;
}

.timeline-content {
    font-size: 13px;
}

.notes-empty p {
    font-size: 11.5px;
}

.choice-body strong {
    font-size: 13.5px;
}

.choice-body small {
    font-size: 11.5px;
}

.switch-copy strong {
    font-size: 13px;
}

.switch-copy small {
    font-size: 10.5px;
}

.permission-item strong {
    font-size: 12.5px;
}

.permission-item span {
    font-size: 11.5px;
}

.member-cell strong {
    font-size: 13px;
}

.number-cell strong {
    font-size: 12.5px;
}

.user-card-name strong {
    font-size: 13.5px;
}

.auth-copy h1 {
    font-size: clamp(32px, 3.2vw, 40px);
}

.auth-copy p {
    font-size: 15px;
}

.auth-point strong {
    font-size: 13.5px;
}

.auth-point span {
    font-size: 12.5px;
}

.auth-footnote {
    font-size: 10.5px;
}

.auth-card h1 {
    font-size: 29px;
}

.auth-sub {
    font-size: 14px;
}

.auth-form {
    gap: 17px;
}

.auth-note {
    font-size: 11.5px;
}

.auth-form .btn-block {
    font-size: 14.5px;
}

.flash {
    font-size: 12.5px;
}

.flash-stack {
    top: 78px;
    right: 32px;
}

.quick-toast {
    font-size: 12.5px;
}

@media (max-width: 1120px) {
    .app-header-inner {
        padding-inline: 32px;
        gap: 18px;
    }

    .top-nav-item {
        padding: 0 10px;
    }
}

@media (max-width: 960px) {
    .app-header-inner {
        height: 58px;
        padding: 0 20px;
    }

    .top-nav {
        display: none;
    }

    .flash-stack {
        top: 68px;
        right: 16px;
    }

    .main-content {
        padding: 24px 20px calc(92px + env(safe-area-inset-bottom));
    }

    .mobile-nav {
        display: flex;
    }
}

@media (max-width: 560px) {
    .app-header-inner {
        height: 56px;
        padding: 0 14px;
    }

    .app-brand .brand-text {
        font-size: 14px;
    }

    .app-brand .brand-text small {
        display: none;
    }

    .header-user-text {
        display: none;
    }

    .header-user {
        padding: 2px;
    }

    .header-logout {
        width: 34px;
        height: 34px;
    }

    .main-content {
        padding: 20px 14px calc(88px + env(safe-area-inset-bottom));
    }

    .page-head h1 {
        font-size: 26px;
    }

    .stat-value {
        font-size: 23px;
    }

    .detail-phone {
        font-size: 28px;
    }

    .panel {
        padding: 18px 16px;
    }

    .mobile-nav-item {
        font-size: 10px;
    }
}

/* 顶部导航后，平板横屏与小型笔记本恢复数据表格 */
@media (min-width: 981px) {
    .stats-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .records-section .table-card {
        display: block;
    }

    .records-section .record-cards {
        display: none;
    }
}

.deal-employee-field[hidden] {
    display: none;
}

.deal-summary {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.deal-name {
    font-size: 12px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.record-card-deal {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}

.date-line.date-soon,
.hero-date.date-soon {
    color: var(--blue);
}

.customer-name {
    display: block;
    min-width: 48px;
    max-width: 120px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.record-card-name {
    display: block;
    margin-top: 8px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.quick-date-control {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 150px;
    max-width: 100%;
}

.quick-date {
    width: 100%;
    min-width: 0;
    padding: 6px 8px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.quick-date:disabled {
    opacity: .6;
    cursor: wait;
}

.quick-date-hint {
    color: var(--muted);
    font-size: 11px;
    white-space: normal;
}

.quick-date-control.state-overdue .quick-date-hint {
    color: var(--coral);
}

.quick-date-control.state-today .quick-date-hint,
.quick-date-control.state-soon .quick-date-hint {
    color: var(--blue);
}

.quick-date-display {
    padding: 4px 0;
    border: 0;
    background: transparent;
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.quick-date-display .quick-date-hint {
    font-size: 13px;
}

.quick-date-display:hover .quick-date-hint {
    color: var(--blue);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.quick-date[hidden],
.quick-date-display[hidden] {
    display: none;
}
