:root {
    --ink: #17232f;
    --muted: #71808d;
    --line: #dfe6eb;
    --paper: #f6f8fa;
    --blue: #1769ff;
    --orange: #ff7144;
    --green: #19a974;
}
* {
    box-sizing: border-box;
}
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
}
.brand-mark {
    font-weight: 800;
    font-size: 24px;
    letter-spacing: 1px;
    color: #fff;
}
.brand-mark span {
    color: #ff8d68;
}
.eyebrow {
    font-size: 11px;
    letter-spacing: 1.5px;
    color: #8a98a5;
    font-weight: 700;
}
.topbar {
    height: 70px;
    background: #14202d;
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0 32px;
    gap: 28px;
}
.top-title {
    border-left: 1px solid #364452;
    padding-left: 26px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.top-title .eyebrow {
    color: #93a4b4;
}
.top-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 13px;
}
.top-actions a {
    color: #bdc8d2;
    text-decoration: none;
}
.icon-btn {
    border: 0;
    background: none;
    color: #bdc8d2;
    font-size: 22px;
    cursor: pointer;
}
.online {
    color: #9fabb7;
}
.online i,
.status-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: #30d49b;
    border-radius: 50%;
    margin-right: 6px;
}
.console {
    max-width: 1440px;
    margin: 0 auto;
    padding: 26px 32px;
}
.admin-main {
    margin: 0 auto;
    padding: 26px 32px;
}
.control-strip {
    background: #fff;
    border: 1px solid var(--line);
    display: flex;
    align-items: end;
    gap: 18px;
    padding: 17px 20px;
    margin-bottom: 18px;
}
.control-strip > div {
    min-width: 190px;
}
.label {
    font-size: 12px;
    color: var(--muted);
    display: block;
    margin-bottom: 7px;
}
.layui-select {
    height: 35px;
    border: 1px solid var(--line);
    padding: 0 10px;
    width: 100%;
    background: #fff;
    color: var(--ink);
}
.strip-spacer {
    flex: 1;
}
.console-grid {
    display: grid;
    grid-template-columns: 250px minmax(420px, 1fr) 290px;
    gap: 18px;
}
.panel {
    background: #fff;
    border: 1px solid var(--line);
    min-height: 560px;
}
.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 22px 16px;
    border-bottom: 1px solid #edf1f4;
}
.panel-head h2 {
    font-size: 18px;
    margin: 5px 0 0;
}
.count-badge {
    background: #eef3f7;
    color: #68798a;
    padding: 4px 9px;
    border-radius: 20px;
    font-size: 12px;
}
.step-list,
.reaction-list {
    padding: 12px;
}
.step-item {
    padding: 16px 14px;
    border-left: 3px solid transparent;
    border-bottom: 1px solid #eef1f4;
    cursor: pointer;
}
.step-item.active {
    background: #f0f5ff;
    border-left-color: var(--blue);
}
.step-item strong {
    display: block;
    font-size: 14px;
}
.step-item small {
    display: block;
    color: var(--muted);
    margin-top: 5px;
    line-height: 1.4;
}
.script-panel {
    display: flex;
    flex-direction: column;
}
.script-content {
    padding: 34px;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: left;
}
.script-text {
    font-size: 28px;
    line-height: 1.7;
    font-weight: 600;
    max-width: 760px;
    white-space: pre-wrap;
}
.script-footer {
    border-top: 1px solid #edf1f4;
    padding: 16px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--muted);
    font-size: 12px;
}
.reaction-item {
    padding: 14px;
    border: 1px solid var(--line);
    margin-bottom: 9px;
    cursor: pointer;
}
.reaction-item:hover {
    border-color: var(--blue);
    background: #f7faff;
}
.reaction-item strong {
    display: block;
}
.reaction-item small {
    color: var(--muted);
    display: block;
    margin-top: 5px;
}
.panel-note {
    font-size: 12px;
    color: var(--muted);
    padding: 20px;
    line-height: 1.6;
}
.empty-state {
    color: #94a2af;
    text-align: center;
    padding: 40px;
}
.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(400px, 520px) 1fr;
    background: #152330;
}
.login-panel {
    background: #fff;
    padding: 70px 76px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.login-panel .brand-mark {
    color: var(--ink);
}
.login-panel h1 {
    font-size: 34px;
    margin: 28px 0 10px;
}
.muted,
.login-panel small {
    color: var(--muted);
}
.login-form {
    margin-top: 36px;
}
.login-form label {
    font-size: 12px;
    color: #52616e;
    display: block;
    margin-bottom: 7px;
}
.login-row {
    display: flex;
    align-items: center;
    gap: 14px;
}
.login-row label {
    margin: 0;
    flex: 1;
}
.login-row .layui-btn {
    height: 44px;
}
.login-error {
    padding: 10px 14px;
    margin-top: 20px;
}
.login-aside {
    padding: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #fff;
    background: linear-gradient(135deg, #1d3344, #213e54);
}
.login-aside h2 {
    font-size: 54px;
    line-height: 1.18;
    margin: 26px 0;
}
.login-aside p {
    max-width: 380px;
    color: #afc0cc;
    line-height: 1.8;
}
.admin-intro {
    display: flex;
    justify-content: space-between;
    align-items: end;
    margin: 25px 0 30px;
}
.admin-intro h1 {
    font-size: 32px;
    margin: 7px 0;
}
.admin-intro p {
    color: var(--muted);
    margin: 0;
}
.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.metric-card {
    background: #fff;
    border: 1px solid var(--line);
    padding: 24px;
    text-decoration: none;
    color: var(--ink);
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.metric-card strong {
    font-size: 42px;
}
.metric-card span:last-child {
    color: var(--muted);
    font-size: 13px;
}
.metric-card b {
    float: right;
    color: var(--blue);
}
.admin-links {
    margin-top: 18px;
    background: #fff;
    border: 1px solid var(--line);
    display: flex;
}
.admin-links a {
    padding: 18px 22px;
    color: var(--ink);
    text-decoration: none;
    border-right: 1px solid var(--line);
}
.admin-table {
    background: #fff;
}
.admin-table td,
.admin-table th {
    font-size: 12px;
}
.flash {
    padding: 12px 16px;
    margin-bottom: 16px;
}
@media (max-width: 1000px) {
    .console-grid {
        grid-template-columns: 1fr;
    }
    .panel {
        min-height: auto;
    }
    .login-shell {
        grid-template-columns: 1fr;
    }
    .login-aside {
        display: none;
    }
    .metric-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
.admin-layout .layui-header {
    background: #14202d;
}
.admin-layout .layui-logo {
    width: 220px;
    color: #fff;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 1px;
}
.admin-layout .layui-logo span {
    color: #ff8d68;
}
.admin-layout .layui-side {
    width: 220px;
    background: #1c2b39 !important;
}
.admin-layout .layui-side-scroll,
.admin-layout .layui-nav-tree {
    width: 220px;
}
.admin-layout .layui-body {
    bottom: 0;
    left: 220px;
    background: var(--paper);
}
.admin-layout .layui-nav-tree {
    background: transparent;
}
.admin-layout .layui-nav-tree .layui-nav-item a {
    height: 48px;
    line-height: 48px;
    color: #bdc8d2;
}
.admin-layout .layui-nav-tree .layui-nav-item a:hover,
.admin-layout .layui-nav-tree .layui-this a {
    color: #fff;
    background: #273b4d;
}
.admin-layout .layui-nav-tree .layui-this:after {
    background-color: var(--blue);
}
.admin-layout .layui-nav-item .layui-icon {
    margin-right: 10px;
    font-size: 16px;
}
.admin-side-title {
    padding: 22px 20px 10px;
    color: #8295a5;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
}
.admin-menu-toggle,
.admin-logout {
    height: 60px;
    padding: 0 18px;
    border: 0;
    color: #fff;
    background: transparent;
    font-size: 16px;
    cursor: pointer;
}
.admin-logout {
    padding: 0 15px;
}
.admin-layout .layui-layout-right form {
    display: block;
}
.admin-layout .layui-nav .layui-nav-item > a {
    color: #d5dfe7;
}
.admin-layout .layui-nav .layui-nav-item > a:hover {
    color: #fff;
}
.admin-layout .layui-nav-bar {
    background-color: #ff8d68;
}
.admin-body .admin-main {
    padding: 26px 32px;
}
.admin-body .admin-table {
    margin-top: 0;
}
.admin-body .layui-table {
    margin-bottom: 16px;
}
.admin-body .layui-laypage {
    margin: 0;
}
@media (max-width: 640px) {
    .admin-layout .layui-logo {
        width: 150px;
        padding-left: 18px;
        text-align: left;
    }
    .admin-layout .layui-side {
        z-index: 1001;
        left: -220px;
        transition: left 0.2s ease;
    }
    .admin-layout.admin-side-open .layui-side {
        left: 0;
    }
    .admin-layout .layui-body {
        left: 0;
    }
    .admin-layout .layui-layout-right {
        right: 0;
    }
    .admin-layout .layui-layout-right .layui-nav-item > a {
        padding: 0 10px;
    }
    .admin-layout .layui-nav .layui-nav-item > a .layui-icon {
        margin: 0;
    }
    .admin-body .admin-main {
        padding: 22px 18px;
    }
    .admin-intro {
        margin: 18px 0 24px;
    }
    .admin-intro h1 {
        font-size: 26px;
    }
    .admin-links {
        overflow-x: auto;
    }
    .admin-links a {
        white-space: nowrap;
    }
    .metric-grid {
        grid-template-columns: 1fr;
    }
}
.sales-app {
    height: 100vh;
    display: grid;
    grid-template-rows: 48px 58px minmax(0, 1fr) 118px;
    background: #e9eef6;
    color: #111827;
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial,
        sans-serif;
    overflow: hidden;
}
.sales-topbar {
    background: #0f172a;
    color: #fff;
    display: grid;
    grid-template-columns:
        minmax(315px, 1fr) 160px 170px 180px minmax(125px, 1fr)
        auto;
    gap: 8px;
    align-items: center;
    padding: 7px 12px;
}
.sales-brand {
    font-size: 17px;
    font-weight: 900;
    white-space: nowrap;
}
.sales-brand span {
    font-size: 12px;
    font-weight: 500;
    color: #cbd5e1;
    margin-left: 8px;
}
.sales-input {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 14px;
    outline: none;
    background: #fff;
    color: #111827;
}
.sales-save-tip {
    color: #cbd5e1;
    font-size: 12px;
    text-align: right;
}
.sales-session {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    white-space: nowrap;
}
.sales-session form {
    margin: 0;
}
.sales-logout {
    border: 0;
    background: transparent;
    color: #cbd5e1;
    font-size: 19px;
    cursor: pointer;
}
.sales-typebar {
    background: #fff;
    border-bottom: 1px solid #dbe3ef;
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 8px;
    align-items: center;
    padding: 8px 12px;
}
.sales-typebar-title {
    font-weight: 900;
    color: #0f172a;
    font-size: 14px;
}
.sales-type-buttons {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding-bottom: 2px;
}
.sales-type-btn,
.sales-btn,
.sales-chip,
.sales-step-btn,
.sales-reaction-btn {
    font-family: inherit;
    cursor: pointer;
}
.sales-type-btn {
    border: 0;
    border-radius: 999px;
    padding: 9px 13px;
    background: #e2e8f0;
    color: #0f172a;
    font-weight: 900;
    font-size: 13px;
    white-space: nowrap;
}
.sales-type-btn.active {
    background: #2563eb;
    color: #fff;
}
.sales-workspace {
    min-height: 0;
    display: grid;
    grid-template-columns: 185px minmax(0, 1fr) 270px;
    gap: 10px;
    padding: 10px;
}
.sales-panel {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    min-height: 0;
}
.sales-panel-title {
    height: 36px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    font-weight: 900;
    font-size: 14px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}
.sales-steps {
    padding: 8px;
    display: grid;
    gap: 7px;
}
.sales-step-btn {
    border: 0;
    border-radius: 12px;
    padding: 10px;
    background: #f1f5f9;
    color: #0f172a;
    font-size: 14px;
    font-weight: 850;
    text-align: left;
}
.sales-step-btn.active {
    background: #2563eb;
    color: #fff;
}
.sales-step-btn small {
    display: block;
    margin-top: 2px;
    color: #64748b;
    font-size: 11px;
    font-weight: 500;
}
.sales-step-btn.active small {
    color: #dbeafe;
}
.sales-center {
    display: grid;
    grid-template-rows: 46px minmax(0, 1fr) 52px;
}
.sales-script-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    border-bottom: 1px solid #e2e8f0;
}
.sales-script-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 900;
    font-size: 18px;
    min-width: 0;
}
.sales-badge {
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}
.sales-badge-blue {
    background: #dbeafe;
    color: #1d4ed8;
}
.sales-badge-green {
    background: #dcfce7;
    color: #15803d;
}
.sales-script-body {
    padding: 18px 22px;
    overflow: auto;
    background: #fff;
}
.sales-script-text {
    white-space: pre-line;
    font-size: 22px;
    line-height: 1.68;
    font-weight: 850;
    letter-spacing: 0;
}
.sales-script-footer {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding: 8px 12px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}
.sales-btn {
    border: 0;
    border-radius: 10px;
    padding: 10px;
    font-size: 14px;
    font-weight: 900;
}
.sales-btn-primary {
    background: #2563eb;
    color: #fff;
}
.sales-btn-green {
    background: #16a34a;
    color: #fff;
}
.sales-btn-dark {
    background: #0f172a;
    color: #fff;
}
.sales-btn-light {
    background: #e2e8f0;
    color: #111827;
}
.sales-reaction-list {
    height: calc(100% - 36px);
    overflow: auto;
    padding: 8px;
}
.sales-reaction-btn {
    width: 100%;
    border: 0;
    border-left: 5px solid #cbd5e1;
    border-radius: 12px;
    padding: 9px 10px;
    background: #f8fafc;
    text-align: left;
    font-size: 13px;
    font-weight: 850;
    margin-bottom: 7px;
    color: #111827;
}
.sales-reaction-btn:hover {
    background: #eef6ff;
}
.sales-reaction-btn span,
.sales-reaction-btn small {
    display: block;
}
.sales-reaction-btn small {
    color: #64748b;
    font-size: 11px;
    margin-top: 2px;
    font-weight: 500;
}
.sales-reaction-btn.hot {
    border-left-color: #ef4444;
}
.sales-reaction-btn.warn {
    border-left-color: #f97316;
}
.sales-reaction-btn.good {
    border-left-color: #16a34a;
}
.sales-reaction-btn.blue-line {
    border-left-color: #2563eb;
}
.sales-faq-title {
    font-size: 12px;
    font-weight: 900;
    color: #64748b;
    padding: 6px 2px;
    margin-top: 4px;
}
.sales-bottom {
    background: #0f172a;
    color: #fff;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 260px;
    gap: 8px;
    padding: 8px 10px;
}
.sales-crm-label {
    color: #cbd5e1;
    font-size: 12px;
    margin-bottom: 5px;
}
.sales-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.sales-chip {
    border: 1px solid #334155;
    background: #1e293b;
    color: #fff;
    border-radius: 999px;
    padding: 6px 8px;
    font-size: 12px;
    font-weight: 800;
}
.sales-chip.active {
    background: #22c55e;
    border-color: #22c55e;
    color: #052e16;
}
.sales-crm-actions {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 7px;
}
.sales-toast {
    position: fixed;
    right: 16px;
    bottom: 132px;
    background: #16a34a;
    color: #fff;
    padding: 10px 16px;
    border-radius: 12px;
    font-weight: 900;
    display: none;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
    z-index: 100;
}
.sales-toast.visible {
    display: block;
}
.sales-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 99;
}
.sales-modal.visible {
    display: flex;
}
.sales-modal-card {
    width: min(760px, 96vw);
    background: #fff;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}
.sales-modal-card h3 {
    margin: 0 0 10px;
}
.sales-modal-card textarea {
    height: 280px;
    line-height: 1.6;
    resize: none;
}
.sales-modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 10px;
}
@media (max-width: 1100px) {
    .sales-app {
        height: auto;
        min-height: 100vh;
        grid-template-rows: auto auto auto auto;
        overflow: visible;
    }
    .sales-topbar {
        grid-template-columns: 1fr 1fr;
    }
    .sales-brand {
        grid-column: 1/-1;
    }
    .sales-save-tip {
        display: none;
    }
    .sales-session {
        justify-self: end;
    }
    .sales-typebar {
        grid-template-columns: 1fr;
    }
    .sales-workspace {
        grid-template-columns: 1fr;
    }
    .sales-panel {
        min-height: 280px;
    }
    .sales-script-text {
        font-size: 20px;
    }
    .sales-bottom {
        grid-template-columns: 1fr;
    }
    .sales-crm-actions {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto;
    }
    .sales-toast {
        bottom: 16px;
    }
}
@media (max-width: 620px) {
    .sales-topbar {
        grid-template-columns: 1fr;
    }
    .sales-brand {
        white-space: normal;
    }
    .sales-brand span {
        display: block;
        margin: 2px 0 0;
    }
    .sales-session {
        justify-self: start;
    }
    .sales-script-head {
        gap: 8px;
        padding: 8px 12px;
        align-items: flex-start;
        flex-direction: column;
    }
    .sales-center {
        grid-template-rows: auto minmax(320px, 1fr) auto;
    }
    .sales-script-title {
        font-size: 16px;
        flex-wrap: wrap;
    }
    .sales-script-footer {
        grid-template-columns: 1fr 1fr;
    }
    .sales-workspace {
        padding: 8px;
    }
    .sales-panel {
        border-radius: 8px;
    }
}
