/* ==================== 全局重置 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-main: #091120;
    --bg-deep: #0c1526;
    --bg-panel: rgba(14, 23, 39, 0.96);
    --bg-panel-2: rgba(10, 18, 32, 0.98);
    --bg-soft: rgba(0, 180, 255, 0.08);
    --bg-soft-2: rgba(0, 180, 255, 0.14);
    --bg-soft-3: rgba(0, 212, 255, 0.18);

    --line-main: rgba(0, 180, 255, 0.34);
    --line-soft: rgba(0, 180, 255, 0.16);
    --line-strong: rgba(0, 212, 255, 0.54);

    --text-main: #e7f6ff;
    --text-soft: #9bb3c7;
    --text-dim: #6e879a;
    --text-cyan: #00d4ff;
    --text-cyan-2: #74eaff;
    --text-warning: #ffcf5c;
    --text-danger: #ff6f6f;
    --text-success: #5ef0bb;

    --shadow-cyan: 0 0 16px rgba(0, 212, 255, 0.14);
    --shadow-cyan-strong: 0 0 22px rgba(0, 212, 255, 0.22);

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

    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

html,
body {
    width: 100%;
    min-height: 100%;
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(0, 180, 255, 0.08), transparent 28%),
        radial-gradient(circle at top right, rgba(0, 140, 255, 0.07), transparent 24%),
        linear-gradient(180deg, #091120 0%, #0b1324 36%, #0f1729 100%);
    color: var(--text-main);
    overflow-x: hidden;
}

body {
    min-width: 1320px;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

input,
select,
textarea {
    outline: none;
}

button {
    border: none;
    background: none;
    cursor: pointer;
}

.hidden {
    display: none !important;
}

summary {
    list-style: none;
}

summary::-webkit-details-marker {
    display: none;
}

/* ==================== 滚动条 ==================== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 180, 255, 0.24);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 180, 255, 0.42);
}

/* ==================== 布局基础 ==================== */
.app-shell {
    width: 100%;
    min-height: 100vh;
    padding: 16px 18px 20px;
}

.main-content {
    margin-top: 14px;
}

.mode-page {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ==================== 顶部栏 ==================== */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 18px 22px;
    border: 1px solid var(--line-main);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(16, 28, 48, 0.96), rgba(12, 20, 36, 0.96));
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.02),
        var(--shadow-cyan);
    position: relative;
}

.top-header::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: inset 0 0 20px rgba(0, 180, 255, 0.05);
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
}

.system-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.system-title {
    font-size: 24px;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: var(--text-cyan);
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.14);
}

.system-subtitle {
    font-size: 12px;
    color: var(--text-soft);
    letter-spacing: 0.2px;
}

.mode-switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: rgba(9, 16, 29, 0.84);
}

.mode-tab {
    min-width: 108px;
    height: 38px;
    padding: 0 16px;
    border-radius: 8px;
    border: 1px solid transparent;
    color: var(--text-soft);
    font-size: 14px;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.mode-tab:hover {
    color: var(--text-cyan-2);
    background: rgba(0, 180, 255, 0.06);
}

.mode-tab.active {
    color: #ffffff;
    background: linear-gradient(180deg, rgba(0, 180, 255, 0.26), rgba(0, 140, 255, 0.16));
    border-color: rgba(0, 212, 255, 0.42);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.14);
}

/* ==================== 悬浮设置按钮 ==================== */
.floating-settings-btn {
    position: fixed;
    right: 22px;
    bottom: 26px;
    z-index: 1200;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 1px solid rgba(0, 212, 255, 0.42);
    background: linear-gradient(180deg, rgba(0, 180, 255, 0.22), rgba(0, 125, 255, 0.12));
    color: #ffffff;
    font-size: 22px;
    box-shadow:
        0 0 18px rgba(0, 212, 255, 0.22),
        inset 0 0 14px rgba(0, 212, 255, 0.08);
    transition: all var(--transition-fast);
}

.floating-settings-btn:hover {
    transform: translateY(-1px);
    box-shadow:
        0 0 24px rgba(0, 212, 255, 0.28),
        inset 0 0 18px rgba(0, 212, 255, 0.12);
}

/* ==================== 遮罩 ==================== */
.overlay {
    position: fixed;
    inset: 0;
    z-index: 1300;
    background: rgba(0, 4, 12, 0.58);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.overlay.show {
    opacity: 1;
    visibility: visible;
}

/* ==================== 设置抽屉 ==================== */
.settings-drawer {
    position: fixed;
    top: 0;
    right: -560px;
    width: 540px;
    max-width: 96vw;
    height: 100vh;
    z-index: 1400;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, rgba(12, 19, 34, 0.985), rgba(9, 15, 28, 0.985));
    border-left: 1px solid var(--line-main);
    box-shadow:
        -10px 0 30px rgba(0, 0, 0, 0.36),
        -2px 0 14px rgba(0, 180, 255, 0.12);
    transition: right var(--transition-normal);
}

.settings-drawer.open {
    right: 0;
}

.drawer-header {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    min-height: 64px;
    padding: 0 18px;
    border-bottom: 1px solid rgba(0, 180, 255, 0.16);
}

.drawer-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-cyan);
}

.drawer-close-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: var(--text-soft);
    background: rgba(255, 255, 255, 0.04);
    font-size: 16px;
    transition: all var(--transition-fast);
}

.drawer-close-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 18px 14px;
}

.drawer-footer {
    flex-shrink: 0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 18px 18px;
    border-top: 1px solid rgba(0, 180, 255, 0.14);
    background: rgba(10, 16, 28, 0.96);
}

.drawer-btn {
    min-width: 96px;
    height: 38px;
    padding: 0 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.drawer-btn.secondary {
    border: 1px solid rgba(0, 180, 255, 0.2);
    background: rgba(0, 180, 255, 0.08);
    color: var(--text-soft);
}

.drawer-btn.secondary:hover {
    background: rgba(0, 180, 255, 0.14);
    color: #ffffff;
}

.drawer-btn.primary {
    border: 1px solid rgba(0, 212, 255, 0.42);
    background: linear-gradient(180deg, rgba(0, 180, 255, 0.26), rgba(0, 135, 255, 0.18));
    color: #ffffff;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.12);
}

.drawer-btn.primary:hover {
    box-shadow: 0 0 16px rgba(0, 212, 255, 0.18);
}

.drawer-btn.danger-lite {
    border-color: rgba(255, 100, 100, 0.24);
    background: rgba(255, 80, 80, 0.08);
    color: #ffb0b0;
}

.drawer-btn.danger-lite:hover {
    background: rgba(255, 80, 80, 0.16);
    color: #ffd6d6;
}

/* ==================== 折叠结构 ==================== */
.setting-accordion {
    margin-bottom: 14px;
    border: 1px solid rgba(0, 180, 255, 0.16);
    border-radius: 12px;
    background: rgba(10, 17, 30, 0.72);
    overflow: hidden;
}

.setting-accordion-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 14px 14px 13px;
    cursor: pointer;
    user-select: none;
    background: linear-gradient(180deg, rgba(0, 180, 255, 0.05), rgba(0, 180, 255, 0.015));
    transition: background var(--transition-fast);
}

.setting-accordion-summary:hover {
    background: linear-gradient(180deg, rgba(0, 180, 255, 0.08), rgba(0, 180, 255, 0.025));
}

.setting-accordion-title-wrap {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.setting-accordion-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-cyan);
}

.setting-accordion-arrow {
    flex-shrink: 0;
    color: var(--text-cyan);
    font-size: 14px;
    transition: transform var(--transition-fast);
}

.setting-accordion[open] > .setting-accordion-summary .setting-accordion-arrow {
    transform: rotate(180deg);
}

.setting-accordion-body {
    padding: 12px 14px 14px;
}

.sub-setting-accordion {
    margin-top: 10px;
    border: 1px solid rgba(0, 180, 255, 0.12);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.015);
    overflow: hidden;
}

.sub-setting-summary {
    position: relative;
    display: flex;
    align-items: center;
    padding: 11px 13px;
    font-size: 13px;
    font-weight: 600;
    color: #b8eaff;
    cursor: pointer;
    user-select: none;
    background: rgba(0, 180, 255, 0.04);
}

.sub-setting-summary::after {
    content: "▾";
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-cyan);
    font-size: 12px;
    transition: transform var(--transition-fast);
}

.sub-setting-accordion[open] > .sub-setting-summary::after {
    transform: translateY(-50%) rotate(180deg);
}

.sub-setting-body {
    padding: 12px;
}

/* ==================== 数据接入概览 ==================== */
.data-access-overview-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.data-access-overview-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid rgba(0, 180, 255, 0.12);
    border-radius: 10px;
    background: rgba(8, 18, 34, 0.72);
}

.data-access-overview-left {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.data-access-name {
    font-size: 14px;
    font-weight: 700;
    color: #d8f6ff;
}

.data-access-name small {
    display: inline-flex;
    align-items: center;
    margin-left: 5px;
    padding: 2px 5px;
    border: 1px solid rgba(39, 215, 255, 0.22);
    border-radius: 999px;
    color: #78dff5;
    background: rgba(0, 180, 255, 0.08);
    font-size: 9px;
    font-weight: 500;
    letter-spacing: .04em;
    vertical-align: middle;
}

.data-access-overview-right {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

/* ==================== 表单项 ==================== */
.setting-section {
    padding: 12px;
    border: 1px solid rgba(0, 180, 255, 0.14);
    border-radius: 10px;
    background: rgba(8, 18, 34, 0.64);
}

.inner-section + .inner-section {
    margin-top: 10px;
}

.section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-cyan);
    margin-bottom: 12px;
}

.setting-item + .setting-item {
    margin-top: 12px;
}

.setting-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: #cbe8f7;
}

.setting-input,
.setting-select {
    width: 100%;
    height: 36px;
    padding: 0 10px;
    border: 1px solid rgba(0, 180, 255, 0.2);
    border-radius: 6px;
    background: rgba(7, 14, 26, 0.96);
    color: var(--text-main);
    font-size: 13px;
    transition: all var(--transition-fast);
}

.setting-input:focus,
.setting-select:focus {
    border-color: var(--line-strong);
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.08);
}

.setting-select {
    cursor: pointer;
}

.readonly-input {
    background: rgba(255, 255, 255, 0.05);
    color: #dff8ff;
}

.inline-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.inline-action-row .drawer-btn {
    min-width: auto;
}

/* ==================== 权重配置 ==================== */
.weight-config-card {
    padding: 12px;
    background: rgba(8, 20, 38, 0.8);
    border: 1px solid rgba(0, 180, 255, 0.14);
    border-radius: 8px;
}

.weight-config-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.weight-config-name {
    font-size: 14px;
    font-weight: 600;
    color: #8fe9ff;
}

.weight-add-btn {
    height: 32px;
    padding: 0 10px;
    border-radius: 6px;
    border: 1px solid rgba(0, 180, 255, 0.28);
    background: rgba(0, 180, 255, 0.1);
    color: var(--text-cyan);
    font-size: 12px;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.weight-add-btn:hover {
    background: rgba(0, 180, 255, 0.18);
    border-color: rgba(0, 212, 255, 0.42);
}

.weight-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.weight-row {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) 110px 64px;
    gap: 8px;
    align-items: center;
}

.weight-group-open-btn {
    min-width: 0;
    height: 36px;
    padding: 0 10px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 7px;
    overflow: hidden;
    border: 1px solid rgba(0, 180, 255, .28);
    border-radius: 6px;
    background: rgba(4, 15, 29, .72);
    color: #d9edf8;
    text-align: left;
    cursor: pointer;
}

.weight-group-open-btn:hover {
    border-color: rgba(0, 212, 255, .7);
    background: rgba(0, 180, 255, .09);
}

.weight-group-name,
.weight-group-member-preview {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.weight-group-name {
    flex: 0 0 auto;
    max-width: 38%;
    color: #d9edf8;
    font-size: 12px;
    font-weight: 650;
}

.weight-group-member-preview {
    min-width: 0;
    flex: 1 1 auto;
    color: #86a9bf;
    font-size: 11px;
}

.weight-remove-btn {
    height: 36px;
    border-radius: 6px;
    border: 1px solid rgba(255, 100, 100, 0.3);
    background: rgba(255, 80, 80, 0.1);
    color: #ff9c9c;
    font-size: 12px;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.weight-remove-btn:hover {
    background: rgba(255, 80, 80, 0.18);
    border-color: rgba(255, 110, 110, 0.42);
}

.weight-total {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-soft);
}

.weight-total.warn {
    color: var(--text-warning);
}

.weight-total.ok {
    color: var(--text-success);
}

.weight-method-note {
    margin-top: 10px;
    color: #7895a8;
    font-size: 12px;
    line-height: 1.55;
}

.workspace-config-headline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: -2px 0 10px;
}

.workspace-mode-badge {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 8px;
    border: 1px solid rgba(0, 212, 255, .25);
    border-radius: 999px;
    background: rgba(0, 180, 255, .08);
    color: #8fe9ff;
    font-size: 11px;
}

.workspace-last-saved {
    color: #7895a8;
    font-size: 11px;
    text-align: right;
}

.workspace-config-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.workspace-config-actions .drawer-btn {
    flex: 1 1 120px;
    min-width: 0;
}

.workspace-config-actions .drawer-btn.danger {
    border-color: rgba(255, 100, 100, .3);
    color: #ff9c9c;
}

.workspace-profile-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 12px;
}

.workspace-profile-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 32px;
    padding: 5px 7px 5px 9px;
    border: 1px solid rgba(0, 180, 255, .16);
    border-radius: 6px;
    background: rgba(4, 15, 29, .52);
    color: #c5dbe8;
    font-size: 11px;
}

.workspace-profile-item.active {
    border-color: rgba(0, 212, 255, .48);
    background: rgba(0, 180, 255, .1);
}

.workspace-profile-load {
    min-height: 24px;
    padding: 0 7px;
    border: 1px solid rgba(0, 180, 255, .24);
    border-radius: 5px;
    background: transparent;
    color: #8fe9ff;
    font-size: 11px;
    cursor: pointer;
}

.workspace-config-note {
    margin-top: 9px;
    color: #7895a8;
    font-size: 11px;
    line-height: 1.45;
}

.cloud-sync-panel {
    margin-top: 16px;
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 12px;
    background: rgba(15, 23, 42, .035);
}

.cloud-sync-status-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 28px;
    margin-bottom: 10px;
}

.cloud-sync-login-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

.public-mode .admin-only-control {
    display: none !important;
}

body.public-mode #symptomConnectBtn,
body.public-mode #opinionConnectBtn,
body.public-mode #medicineConnectBtn,
body.public-mode #sentimentImportBtn {
    display: none;
}

body.public-mode .workspace-mode-badge {
    border-color: rgba(60, 230, 165, .3);
    background: rgba(60, 230, 165, .08);
    color: #7ff0c4;
}

.weight-group-backdrop {
    position: fixed;
    z-index: 1250;
    inset: 0;
    background: rgba(0, 8, 18, .68);
    backdrop-filter: blur(2px);
}

.weight-group-modal {
    position: fixed;
    z-index: 1260;
    top: 50%;
    left: 50%;
    width: min(520px, calc(100vw - 28px));
    transform: translate(-50%, -50%);
    overflow: hidden;
    border: 1px solid rgba(0, 212, 255, .38);
    border-radius: 12px;
    background: #0a1829;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .48);
}

.weight-group-modal-header,
.weight-group-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
}

.weight-group-modal-header {
    border-bottom: 1px solid rgba(0, 180, 255, .16);
}

.weight-group-modal-header h2 {
    margin: 2px 0 0;
    color: #e8f8ff;
    font-size: 18px;
}

.weight-group-eyebrow {
    color: var(--text-cyan);
    font-size: 11px;
    letter-spacing: .08em;
}

.weight-group-modal-body {
    padding: 16px 18px;
}

.weight-group-modal-body .setting-label {
    display: block;
    margin: 0 0 7px;
}

.weight-group-modal-body .setting-label:not(:first-child) {
    margin-top: 16px;
}

.weight-member-list {
    min-height: 42px;
    padding: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    border: 1px solid rgba(0, 180, 255, .18);
    border-radius: 7px;
    background: rgba(3, 13, 27, .54);
}

.weight-member-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 7px 4px 9px;
    border: 1px solid rgba(0, 212, 255, .24);
    border-radius: 999px;
    background: rgba(0, 180, 255, .1);
    color: #cceefb;
    font-size: 12px;
}

.weight-member-chip button {
    width: 16px;
    height: 16px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 130, 130, .22);
    color: #ffd0d0;
    cursor: pointer;
    line-height: 14px;
}

.weight-member-empty,
.weight-group-hint,
.weight-group-method {
    color: #7895a8;
    font-size: 12px;
    line-height: 1.55;
}

.weight-member-add-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    margin-top: 10px;
}

.weight-group-hint {
    margin: 8px 0 0;
}

.weight-group-method {
    margin-top: 14px;
    padding: 10px;
    border-radius: 6px;
    background: rgba(0, 180, 255, .06);
}

.weight-group-modal-footer {
    justify-content: flex-end;
    border-top: 1px solid rgba(0, 180, 255, .16);
}

/* ==================== 风险分级 ==================== */
.risk-config-table {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.risk-config-head,
.risk-config-row {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) 84px 1fr 1fr;
    gap: 8px;
    align-items: center;
}

.risk-config-head {
    padding: 0 2px;
    font-size: 12px;
    color: var(--text-soft);
}

.color-input {
    min-width: 72px;
    padding: 4px 6px;
    cursor: pointer;
}

/* ==================== 算法编辑器 ==================== */
.algorithm-code-textarea {
    width: 100%;
    min-height: 300px;
    padding: 12px;
    border: 1px solid rgba(0, 180, 255, 0.18);
    border-radius: 8px;
    background: rgba(7, 14, 26, 0.98);
    color: #dff7ff;
    font-family: Consolas, Monaco, "Courier New", monospace;
    font-size: 12px;
    line-height: 1.65;
    resize: vertical;
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.editor-status-box,
.editor-preview-box,
.editor-error-box {
    margin-top: 10px;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.65;
    word-break: break-word;
}

.editor-status-box {
    border: 1px solid rgba(0, 180, 255, 0.16);
    background: rgba(0, 180, 255, 0.06);
    color: #b8eaff;
    min-height: 42px;
}

.editor-preview-box {
    border: 1px solid rgba(94, 240, 187, 0.16);
    background: rgba(94, 240, 187, 0.06);
    color: #d8fff0;
    min-height: 56px;
}

.editor-error-box {
    border: 1px solid rgba(255, 111, 111, 0.18);
    background: rgba(255, 111, 111, 0.06);
    color: #ffd2d2;
    min-height: 42px;
}

/* CodeMirror 深色风格 */
.CodeMirror {
    height: 320px;
    border: 1px solid rgba(0, 180, 255, 0.18);
    border-radius: 8px;
    background: rgba(7, 14, 26, 0.98);
    color: #dff7ff;
    font-size: 12px;
    line-height: 1.6;
}

.CodeMirror-gutters {
    background: rgba(4, 10, 20, 0.96);
    border-right: 1px solid rgba(0, 180, 255, 0.12);
}

.CodeMirror-linenumber {
    color: #6e879a;
}

.CodeMirror-cursor {
    border-left: 1px solid #74eaff !important;
}

.CodeMirror-selected {
    background: rgba(0, 180, 255, 0.16) !important;
}

.CodeMirror-lines {
    padding: 8px 0;
}

.cm-s-default .cm-keyword {
    color: #7fd6ff;
}

.cm-s-default .cm-def {
    color: #ffd479;
}

.cm-s-default .cm-number {
    color: #ffb86c;
}

.cm-s-default .cm-string {
    color: #8be9a8;
}

.cm-s-default .cm-comment {
    color: #7e96a8;
}

.cm-s-default .cm-variable,
.cm-s-default .cm-variable-2,
.cm-s-default .cm-variable-3 {
    color: #dff7ff;
}

.cm-s-default .cm-property {
    color: #9dd7ff;
}

.CodeMirror-lint-tooltip {
    z-index: 9999;
    background: #0b1525;
    border: 1px solid rgba(255, 111, 111, 0.4);
    color: #ffd9d9;
}

/* ==================== 通用面板 ==================== */
.panel-card,
.overview-card,
.map-card,
.timeline-compact {
    position: relative;
    border: 1px solid var(--line-main);
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, rgba(15, 24, 40, 0.96), rgba(11, 18, 33, 0.96));
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.015),
        0 0 14px rgba(0, 180, 255, 0.05);
}

.panel-card::before,
.overview-card::before,
.map-card::before,
.timeline-compact::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: inset 0 0 16px rgba(0, 180, 255, 0.04);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    min-height: 42px;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(0, 180, 255, 0.12);
    background: rgba(255, 255, 255, 0.012);
}

.panel-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-cyan);
}

.panel-title.big-title {
    font-size: 18px;
}

.panel-body {
    padding: 12px;
}

.panel-placeholder {
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
    text-align: center;
    color: var(--text-dim);
}

.compact-placeholder {
    min-height: 138px;
}

.placeholder-title {
    font-size: 15px;
    color: #abc7da;
}

/* ==================== 顶部概览 ==================== */
.overview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 220px));
    gap: 12px;
}

.overview-card {
    padding: 14px 16px;
    min-height: 84px;
}

.warning-card-action {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto 1fr;
    align-items: start;
    text-align: left;
    cursor: pointer;
    background:
        linear-gradient(135deg, rgba(255, 82, 102, 0.11), rgba(255, 174, 83, 0.045) 52%, rgba(13, 23, 40, 0.7));
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.warning-card-action:hover {
    border-color: rgba(255, 116, 116, 0.62);
    box-shadow: 0 0 22px rgba(255, 84, 104, 0.13);
    transform: translateY(-1px);
}

.overview-card.warning-card {
    border-color: rgba(255, 110, 110, 0.26);
}

.overview-card.monitor-card {
    border-color: rgba(0, 212, 255, 0.28);
}

.overview-label {
    font-size: 13px;
    color: var(--text-soft);
    margin-bottom: 10px;
}

.warning-card-action .overview-label { grid-column: 1; }

.warning-card-action .overview-value {
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: center;
    color: #fff4f3;
}

.overview-hint {
    grid-column: 1;
    color: #f0a5a3;
    font-size: 11px;
}

.overview-value {
    font-size: 26px;
    font-weight: 700;
    color: #ffffff;
}

/* ==================== 全国趋势图 ==================== */
.trend-panel-header {
    align-items: center;
}

.trend-header-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.segmented-switch {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border: 1px solid rgba(0, 180, 255, 0.16);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
}

.seg-btn {
    min-width: 82px;
    height: 30px;
    padding: 0 12px;
    border-radius: 7px;
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.seg-btn:hover {
    color: var(--text-cyan-2);
    background: rgba(0, 180, 255, 0.08);
}

.seg-btn.active {
    color: #ffffff;
    background: linear-gradient(180deg, rgba(0, 180, 255, 0.22), rgba(0, 140, 255, 0.14));
    border: 1px solid rgba(0, 212, 255, 0.3);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.12);
}

.trend-chart-body {
    position: relative;
    min-height: 280px;
    padding: 12px;
}

.national-trend-chart {
    width: 100%;
    height: 280px;
    min-height: 280px;
}

.national-trend-empty {
    position: absolute;
    inset: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    font-size: 13px;
    border: 1px dashed rgba(0, 180, 255, 0.14);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.01);
    pointer-events: none;
}

/* ==================== 地图区域 ==================== */
.maps-section {
    display: grid;
    gap: 12px;
}

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

.map-card {
    overflow: hidden;
}

.enhanced-map-card {
    display: flex;
    flex-direction: column;
}

.map-card-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px 10px;
    border-bottom: 1px solid rgba(0, 180, 255, 0.12);
    background: linear-gradient(180deg, rgba(0, 180, 255, 0.04), rgba(255, 255, 255, 0.01));
}

.map-card-toolbar-left {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.map-card-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-cyan);
    line-height: 1.2;
}

.compact-region-shortcuts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin-top: 3px;
}

.compact-region-shortcuts > span {
    margin-right: 2px;
    color: var(--text-dim);
    font-size: 10px;
    white-space: nowrap;
}

.compact-region-shortcuts button {
    height: 23px;
    min-width: 32px;
    padding: 0 6px;
    border: 1px solid rgba(0, 180, 255, 0.22);
    border-radius: 5px;
    color: #a9d8e9;
    background: rgba(0, 180, 255, 0.06);
    font-size: 10px;
    transition: all var(--transition-fast);
}

.compact-region-shortcuts button:hover,
.compact-region-shortcuts button.active {
    color: #ffffff;
    border-color: rgba(0, 212, 255, 0.62);
    background: rgba(0, 180, 255, 0.2);
    box-shadow: 0 0 9px rgba(0, 212, 255, 0.14);
}

.map-card-toolbar-right {
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.map-data-status-group {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.data-status-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 62px;
    height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid transparent;
    white-space: nowrap;
}

.data-status-chip.pending {
    color: #b8d2e4;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

.data-status-chip.connected {
    color: #dfffee;
    background: rgba(72, 214, 160, 0.16);
    border-color: rgba(72, 214, 160, 0.32);
}

.data-status-chip.updating {
    color: #dff8ff;
    background: rgba(0, 212, 255, 0.16);
    border-color: rgba(0, 212, 255, 0.32);
}

.data-status-chip.error {
    color: #ffe3e3;
    background: rgba(255, 80, 80, 0.14);
    border-color: rgba(255, 80, 80, 0.28);
}

.data-update-text {
    font-size: 11px;
    color: var(--text-dim);
    white-space: nowrap;
}

.map-connect-btn {
    height: 34px;
    padding: 0 14px;
    border-radius: 8px;
    border: 1px solid rgba(0, 212, 255, 0.34);
    background: linear-gradient(180deg, rgba(0, 180, 255, 0.2), rgba(0, 120, 255, 0.1));
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.08);
    transition: all var(--transition-fast);
}

.map-connect-btn:hover {
    background: linear-gradient(180deg, rgba(0, 180, 255, 0.28), rgba(0, 120, 255, 0.14));
    box-shadow: 0 0 14px rgba(0, 212, 255, 0.14);
}

.map-box-wrap {
    position: relative;
    width: 100%;
    min-height: 430px;
}

.map-box {
    width: 100%;
    height: 430px;
    min-height: 430px;
    position: relative;
    background: linear-gradient(180deg, rgba(10, 16, 30, 0.97), rgba(11, 17, 30, 0.99));
}

.map-box > div,
.map-box canvas {
    border-radius: 8px;
}

.map-overlay-layer {
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
}

/* ==================== 地区标记 ==================== */
.region-marker {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -110%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.95), rgba(0, 212, 255, 0.95) 40%, rgba(0, 120, 255, 0.92) 100%);
    border: 2px solid rgba(255, 255, 255, 0.82);
    box-shadow:
        0 0 16px rgba(0, 212, 255, 0.28),
        0 0 22px rgba(0, 212, 255, 0.18);
    pointer-events: none;
    animation: markerPulse 1.8s infinite;
}

.region-marker-icon {
    font-size: 16px;
    line-height: 1;
    filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.28));
}

@keyframes markerPulse {
    0% {
        box-shadow:
            0 0 0 0 rgba(0, 212, 255, 0.42),
            0 0 18px rgba(0, 212, 255, 0.24);
    }
    70% {
        box-shadow:
            0 0 0 12px rgba(0, 212, 255, 0),
            0 0 24px rgba(0, 212, 255, 0.18);
    }
    100% {
        box-shadow:
            0 0 0 0 rgba(0, 212, 255, 0),
            0 0 18px rgba(0, 212, 255, 0.2);
    }
}

/* ==================== 悬浮趋势卡片 ==================== */
.trend-popup-card {
    position: absolute;
    top: 12px;
    right: 12px;
    width: min(380px, calc(100% - 24px));
    min-height: 272px;
    border: 1px solid rgba(0, 212, 255, 0.32);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(9, 18, 32, 0.96), rgba(8, 14, 26, 0.97));
    box-shadow:
        0 10px 28px rgba(0, 0, 0, 0.28),
        0 0 18px rgba(0, 212, 255, 0.16);
    overflow: hidden;
    pointer-events: auto;
    backdrop-filter: blur(4px);
}

.trend-popup-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px 10px;
    border-bottom: 1px solid rgba(0, 180, 255, 0.14);
    background: rgba(0, 180, 255, 0.04);
}

.trend-popup-head-left {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.trend-popup-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-cyan);
    line-height: 1.3;
}

.trend-popup-meta {
    font-size: 12px;
    color: var(--text-soft);
}

.trend-popup-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
    color: var(--text-soft);
    background: rgba(255, 255, 255, 0.04);
    transition: all var(--transition-fast);
}

.trend-popup-close:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.trend-popup-body {
    padding: 12px;
}

.trend-popup-chart {
    width: 100%;
    height: 210px;
    min-height: 210px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.015);
}

.trend-popup-empty {
    margin-top: 10px;
    min-height: 44px;
    border: 1px dashed rgba(0, 180, 255, 0.16);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    text-align: center;
    font-size: 12px;
    color: var(--text-dim);
}

/* ==================== 时间控制区 ==================== */
.timeline-compact {
    display: grid;
    grid-template-columns: auto auto auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
}

.timeline-range,
.timeline-shortcuts,
.timeline-current,
.timeline-slider-wrap,
.timeline-play {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tl-label,
.speed-label {
    font-size: 13px;
    color: var(--text-soft);
    white-space: nowrap;
}

.tl-date,
.tl-current-input,
.speed-input {
    height: 34px;
    padding: 0 10px;
    border: 1px solid rgba(0, 180, 255, 0.2);
    border-radius: 6px;
    background: rgba(7, 14, 26, 0.96);
    color: var(--text-main);
    font-size: 13px;
    transition: all var(--transition-fast);
}

.tl-date:focus,
.tl-current-input:focus,
.speed-input:focus {
    border-color: var(--line-strong);
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.08);
}

.tl-date {
    width: 138px;
}

.tl-current-input {
    width: 130px;
}

.speed-input {
    width: 76px;
    text-align: center;
}

.speed-unit {
    font-size: 12px;
    color: var(--text-dim);
    white-space: nowrap;
}

.tl-sep {
    font-size: 12px;
    color: var(--text-dim);
}

.tl-apply-btn,
.tl-shortcut,
.icon-btn,
.mini-action-btn {
    transition: all var(--transition-fast);
}

.tl-apply-btn,
.tl-shortcut,
.mini-action-btn {
    height: 34px;
    padding: 0 12px;
    border-radius: 6px;
    border: 1px solid rgba(0, 180, 255, 0.24);
    background: rgba(0, 180, 255, 0.08);
    color: var(--text-cyan);
    font-size: 12px;
    font-weight: 600;
}

.tl-apply-btn:hover,
.tl-shortcut:hover,
.mini-action-btn:hover {
    background: rgba(0, 180, 255, 0.16);
    border-color: rgba(0, 212, 255, 0.45);
}

.tl-shortcut.active {
    color: #ffffff;
    border-color: rgba(0, 212, 255, 0.45);
    background: linear-gradient(180deg, rgba(0, 180, 255, 0.22), rgba(0, 140, 255, 0.14));
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.15);
}

.timeline-slider-wrap {
    min-width: 0;
    gap: 10px;
}

.timeline-end-label {
    font-size: 12px;
    color: var(--text-dim);
    white-space: nowrap;
}

.timeline-slider {
    flex: 1;
    min-width: 220px;
    accent-color: #00d4ff;
    cursor: pointer;
}

.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(0, 180, 255, 0.32);
    background: rgba(0, 180, 255, 0.1);
    color: var(--text-cyan);
    font-size: 16px;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.08);
}

.icon-btn:hover {
    background: rgba(0, 180, 255, 0.18);
    box-shadow: 0 0 14px rgba(0, 212, 255, 0.14);
}

.speed-box {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ==================== 第二页巡查 ==================== */
.patrol-top-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
}

.patrol-top-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.patrol-status-line {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-soft);
}

.patrol-province-name {
    font-size: 18px;
    font-weight: 700;
    color: #ffcc66;
}

.patrol-progress {
    font-size: 13px;
    color: var(--text-dim);
}

.patrol-top-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.patrol-upper-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.patrol-maps .map-box {
    height: 360px;
    min-height: 360px;
}

.province-summary-panel .panel-body {
    min-height: 92px;
}

/* ==================== 表单细节 ==================== */
input::placeholder,
textarea::placeholder {
    color: #60778a;
}

select option {
    background: #0f1828;
    color: var(--text-main);
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    margin: 0;
}

/* ==================== 响应式保底 ==================== */
@media (max-width: 1750px) {
    .map-card-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .map-card-toolbar-right {
        justify-content: space-between;
    }

    .map-data-status-group {
        align-items: flex-start;
    }

    .data-access-overview-item {
        align-items: flex-start;
    }
}

@media (max-width: 1680px) {
    .settings-drawer {
        width: 500px;
    }

    .timeline-compact {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .timeline-range,
    .timeline-shortcuts,
    .timeline-current,
    .timeline-slider-wrap,
    .timeline-play {
        flex-wrap: wrap;
    }
}

@media (max-width: 1550px) {
    body {
        min-width: 1180px;
    }

    .map-box,
    .map-box-wrap {
        min-height: 400px;
    }

    .map-box {
        height: 400px;
    }

    .trend-popup-card {
        width: min(340px, calc(100% - 24px));
    }

    .national-trend-chart {
        height: 260px;
        min-height: 260px;
    }
}

@media (max-width: 1400px) {
    body {
        min-width: 1080px;
    }

    .maps-3col,
    .patrol-upper-grid {
        grid-template-columns: 1fr;
    }

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

    .patrol-maps .map-box {
        height: 320px;
        min-height: 320px;
    }
}

/* ==================== 第二页：情绪指数 ==================== */
.sentiment-page {
    --sentiment-cyan: #27d7ff;
    --sentiment-blue: #168cff;
    --sentiment-green: #3ce6a5;
    --sentiment-yellow: #ffc857;
    --sentiment-red: #ff5f70;
    position: relative;
    isolation: isolate;
}

.sentiment-page::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 124px 0 0;
    pointer-events: none;
    opacity: .58;
    background-image: linear-gradient(rgba(39, 215, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(39, 215, 255, .03) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: linear-gradient(to bottom, #000, transparent 82%);
}

.sentiment-toolbar,
.sentiment-timebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 18px;
    position: relative;
    overflow: hidden;
    border-color: rgba(34, 180, 246, .32);
    background: linear-gradient(110deg, rgba(13, 29, 51, .98), rgba(9, 21, 39, .97) 55%, rgba(11, 35, 56, .92));
    box-shadow: inset 0 1px 0 rgba(160, 238, 255, .07), 0 12px 28px rgba(0, 4, 16, .18);
}

.sentiment-toolbar::after,
.sentiment-timebar::after {
    content: "";
    position: absolute;
    top: 0;
    right: 8%;
    width: 190px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(84, 228, 255, .9), transparent);
    box-shadow: 0 0 13px rgba(39, 215, 255, .8);
}

.sentiment-heading,
.sentiment-actions,
.sentiment-shortcuts,
.sentiment-custom-range {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sentiment-analysis-window-note {
    margin-left: 2px;
    color: var(--text-dim);
    font-size: 11px;
    white-space: nowrap;
}

.sentiment-warning-card {
    position: relative;
    min-width: 190px;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 0 10px;
    padding: 8px 12px 8px 14px;
    border: 1px solid rgba(255, 112, 108, .34);
    border-radius: 10px;
    color: #ffdfdb;
    background: linear-gradient(110deg, rgba(115, 35, 47, .34), rgba(34, 26, 40, .75));
    box-shadow: inset 0 1px 0 rgba(255, 214, 204, .08), 0 8px 22px rgba(0, 0, 0, .16);
    text-align: left;
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.sentiment-warning-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 133, 122, .72);
    box-shadow: inset 0 1px 0 rgba(255, 214, 204, .12), 0 10px 28px rgba(118, 22, 38, .22);
}

.sentiment-warning-card-label { color: #ffbbb4; font-size: 11px; }
.sentiment-warning-card strong { color: #fff5f3; font-size: 23px; line-height: 1.05; }
.sentiment-warning-card span:last-child { grid-column: 1 / -1; margin-top: 4px; color: #d9a9a7; font-size: 10px; }

.sentiment-heading {
    gap: 14px;
}

.sentiment-subtitle {
    margin-top: 5px;
    color: var(--text-soft);
    font-size: 12px;
}

.sentiment-live-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    color: #79b9cb;
    font-size: 11px;
}

.sentiment-live-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #5ef0bb;
    box-shadow: 0 0 0 0 rgba(94, 240, 187, 0.55);
    animation: sentimentLivePulse 1.8s infinite;
}

.sentiment-live-meta.idle .sentiment-live-dot {
    background: #6e879a;
    animation: none;
    box-shadow: none;
}

.sentiment-live-meta.restoring .sentiment-live-dot {
    background: #27d7ff;
}

.sentiment-live-separator {
    color: #496d80;
}

@keyframes sentimentLivePulse {
    0% { box-shadow: 0 0 0 0 rgba(94, 240, 187, 0.52); }
    70% { box-shadow: 0 0 0 8px rgba(94, 240, 187, 0); }
    100% { box-shadow: 0 0 0 0 rgba(94, 240, 187, 0); }
}

.sentiment-primary-btn,
.sentiment-secondary-btn,
.sentiment-scope-btn,
.sentiment-range-btn {
    height: 36px;
    padding: 0 15px;
    border-radius: 7px;
    border: 1px solid rgba(39, 215, 255, 0.34);
    color: #dffaff;
    font-size: 13px;
    font-weight: 700;
    transition: all var(--transition-fast);
}

.sentiment-primary-btn {
    background: linear-gradient(135deg, rgba(0, 190, 255, 0.42), rgba(25, 113, 255, 0.32));
    box-shadow: 0 0 14px rgba(0, 197, 255, 0.16);
}

.sentiment-secondary-btn,
.sentiment-scope-btn,
.sentiment-range-btn {
    background: rgba(0, 180, 255, 0.07);
}

.sentiment-primary-btn:hover,
.sentiment-secondary-btn:hover,
.sentiment-scope-btn:hover,
.sentiment-range-btn:hover,
.sentiment-range-btn.active {
    border-color: rgba(39, 215, 255, 0.68);
    background: rgba(0, 180, 255, 0.18);
    box-shadow: 0 0 14px rgba(0, 197, 255, 0.14);
}

.sentiment-range-btn.active {
    color: #fff;
}

.sentiment-timebar {
    justify-content: flex-start;
    flex-wrap: wrap;
}

.sentiment-evolution-bar {
    display: grid;
    grid-template-columns: auto auto minmax(260px, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 11px 16px;
    border-color: rgba(45, 188, 241, .28);
    background: linear-gradient(100deg, rgba(13, 30, 51, .98), rgba(8, 20, 37, .98));
    box-shadow: inset 0 1px 0 rgba(174, 239, 255, .06), 0 8px 20px rgba(0, 0, 0, .12);
}

.sentiment-evolution-title,
.sentiment-evolution-current,
.sentiment-evolution-slider-wrap {
    display: flex;
    align-items: center;
}

.sentiment-evolution-title { gap: 7px; white-space: nowrap; }
.sentiment-evolution-title .sentiment-live-dot { width: 6px; height: 6px; animation: none; box-shadow: 0 0 8px rgba(94, 240, 187, .6); }
.sentiment-evolution-title strong { color: #dffaff; font-size: 13px; }
.sentiment-evolution-title span:last-child { color: var(--text-dim); font-size: 11px; }
.sentiment-evolution-current { gap: 7px; color: var(--text-soft); font-size: 12px; }
.sentiment-evolution-current .tl-date { width: 138px; }
.sentiment-evolution-slider-wrap { min-width: 0; gap: 9px; }
.sentiment-evolution-slider-wrap .timeline-slider { flex: 1; min-width: 120px; }

.sentiment-play-btn {
    min-width: 68px;
    height: 32px;
    padding: 0 10px;
    border: 1px solid rgba(39, 215, 255, .35);
    border-radius: 7px;
    color: #cef8ff;
    background: rgba(0, 180, 255, .09);
    font-size: 12px;
    font-weight: 700;
}

.sentiment-play-btn:hover:not(:disabled) { border-color: rgba(39, 215, 255, .72); background: rgba(0, 180, 255, .18); }
.sentiment-play-btn:disabled { opacity: .4; cursor: not-allowed; }

.sentiment-custom-range {
    color: var(--text-soft);
    font-size: 13px;
}

.sentiment-scope-btn {
    margin-left: auto;
}

.sentiment-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(245px, 0.82fr) minmax(480px, 1.7fr) minmax(390px, 1.28fr);
    gap: 12px;
}

.sentiment-dashboard-grid > .panel-card {
    min-width: 0;
    overflow: hidden;
    position: relative;
    border-color: rgba(38, 162, 224, .27);
    background: linear-gradient(145deg, rgba(18, 35, 58, .98), rgba(10, 21, 38, .98) 60%, rgba(8, 25, 44, .96));
    box-shadow: inset 0 1px 0 rgba(189, 244, 255, .055), inset 0 -12px 26px rgba(0, 2, 11, .16), 0 15px 30px rgba(0, 3, 15, .22);
}

.sentiment-dashboard-grid > .panel-card::before,
.sentiment-summary-grid > .panel-card::before,
.sentiment-detail-card::before {
    content: "";
    position: absolute;
    z-index: 0;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(125deg, rgba(101, 235, 255, .06), transparent 18%, transparent 72%, rgba(0, 129, 255, .075));
}

.sentiment-dashboard-grid > .panel-card > *,
.sentiment-summary-grid > .panel-card > *,
.sentiment-detail-card > * { position: relative; z-index: 1; }

.panel-hint {
    color: var(--text-dim);
    font-size: 12px;
    font-weight: 400;
}

.sentiment-level-chip {
    min-width: 70px;
    padding: 5px 9px;
    border-radius: 999px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: #dff7ff;
    border: 1px solid rgba(155, 179, 199, 0.28);
    background: rgba(155, 179, 199, 0.10);
}

.sentiment-level-chip.panic { color: #ffdbe0; border-color: rgba(255, 95, 112, .45); background: rgba(255, 95, 112, .13); }
.sentiment-level-chip.anxiety { color: #fff0ce; border-color: rgba(255, 166, 84, .45); background: rgba(255, 166, 84, .13); }
.sentiment-level-chip.neutral { color: #fff2c4; border-color: rgba(255, 200, 87, .42); background: rgba(255, 200, 87, .11); }
.sentiment-level-chip.positive { color: #d7fff0; border-color: rgba(60, 230, 165, .44); background: rgba(60, 230, 165, .12); }

.sentiment-gauge-chart {
    width: 100%;
    height: 235px;
}

.sentiment-donut-chart {
    width: 100%;
    height: 205px;
    border-top: 1px solid rgba(0, 180, 255, 0.09);
}

.sentiment-map-card,
.sentiment-trend-card {
    position: relative;
}

.sentiment-trend-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    min-width: 0;
    color: var(--text-dim);
    font-size: 11px;
}

.sentiment-trend-window-select,
.sentiment-trend-window-custom {
    height: 27px;
    padding: 0 7px;
    border: 1px solid rgba(39, 215, 255, .23);
    border-radius: 6px;
    color: #cceef7;
    background: rgba(4, 14, 28, .72);
    font-size: 11px;
}

.sentiment-trend-window-custom { width: 52px; }
.sentiment-trend-tools .panel-hint { max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sentiment-map-card::after,
.sentiment-trend-card::after {
    content: "";
    position: absolute;
    z-index: 0;
    inset: 50px 10px 12px;
    border: 1px solid rgba(45, 210, 255, .075);
    border-radius: 10px;
    background: radial-gradient(ellipse at 50% 28%, rgba(0, 167, 255, .10), transparent 54%), linear-gradient(180deg, rgba(1, 11, 23, .18), rgba(1, 11, 22, .46));
    box-shadow: inset 0 0 32px rgba(0, 194, 255, .035);
    pointer-events: none;
}

.sentiment-map-chart,
.sentiment-trend-chart {
    width: 100%;
    height: 440px;
}

.sentiment-chart-empty {
    position: absolute;
    inset: 56px 12px 12px;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border: 1px dashed rgba(0, 180, 255, 0.16);
    border-radius: 8px;
    color: var(--text-dim);
    font-size: 13px;
    text-align: center;
    background: rgba(9, 17, 32, 0.78);
    pointer-events: none;
}

.sentiment-summary-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
}

.sentiment-summary-grid > .panel-card,
.sentiment-detail-card {
    position: relative;
    overflow: hidden;
    border-color: rgba(38, 162, 224, .25);
    background: linear-gradient(145deg, rgba(16, 31, 52, .98), rgba(9, 18, 33, .98));
    box-shadow: inset 0 1px 0 rgba(189, 244, 255, .05), 0 13px 28px rgba(0, 3, 15, .19);
}

.sentiment-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    background: rgba(0, 180, 255, 0.10);
}

.sentiment-kpis > div {
    min-height: 105px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(155deg, rgba(19, 34, 54, .9), rgba(9, 17, 31, .94));
    box-shadow: inset 0 1px 0 rgba(170, 237, 255, .035);
}

.sentiment-kpis span {
    color: var(--text-soft);
    font-size: 12px;
}

.sentiment-kpis strong {
    color: #fff;
    font-size: 25px;
    font-weight: 700;
}

.sentiment-ranking-list {
    min-height: 105px;
    max-height: 150px;
    padding: 9px 12px;
    overflow: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px 14px;
}

.sentiment-ranking-item {
    display: grid;
    grid-template-columns: 24px 54px 1fr 42px;
    align-items: center;
    gap: 7px;
    min-width: 0;
    color: var(--text-soft);
    font-size: 12px;
    cursor: pointer;
}

.sentiment-ranking-item:hover,
.sentiment-ranking-item.selected {
    color: #fff;
}

.sentiment-ranking-number {
    color: var(--text-dim);
    text-align: center;
}

.sentiment-ranking-bar {
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.sentiment-ranking-bar i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #ff6575, #ffc857 55%, #3ce6a5);
}

.sentiment-empty-row {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 82px;
    color: var(--text-dim);
    font-size: 13px;
}

.sentiment-table-wrap {
    max-height: 295px;
    overflow: auto;
}

.sentiment-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.sentiment-table th,
.sentiment-table td {
    padding: 11px 13px;
    border-bottom: 1px solid rgba(0, 180, 255, 0.09);
    color: var(--text-soft);
    font-size: 12px;
    text-align: left;
}

.sentiment-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    color: #d9f7ff;
    background: #0e192b;
}

.sentiment-table th:nth-child(1) { width: 108px; }
.sentiment-table th:nth-child(2) { width: 78px; }
.sentiment-table th:nth-child(3) { width: 104px; }
.sentiment-table th:nth-child(4) { width: 72px; }
.sentiment-table td:last-child { color: #bcd2e0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sentiment-inline-level {
    display: inline-block;
    padding: 3px 7px;
    border-radius: 999px;
    color: #fff;
    background: rgba(0, 180, 255, 0.12);
}

.sentiment-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(2, 7, 15, 0.72);
    backdrop-filter: blur(2px);
}

.sentiment-settings-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 2001;
    width: min(520px, calc(100vw - 40px));
    transform: translate(-50%, -50%);
    border: 1px solid rgba(39, 215, 255, 0.42);
    border-radius: 12px;
    background: linear-gradient(180deg, #101d31, #0b1424);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .5), 0 0 28px rgba(0, 212, 255, .13);
    overflow: hidden;
    max-height: min(840px, calc(100vh - 34px));
}

.sentiment-settings-body {
    padding: 18px;
    overflow: auto;
    max-height: min(690px, calc(100vh - 150px));
}

.sentiment-settings-note,
.sentiment-settings-example {
    padding: 11px 12px;
    border: 1px solid rgba(0, 180, 255, 0.13);
    border-radius: 8px;
    color: var(--text-soft);
    background: rgba(0, 180, 255, 0.04);
    font-size: 12px;
    line-height: 1.6;
}

.sentiment-warning-settings {
    margin-top: 18px;
    padding: 14px;
    border: 1px solid rgba(255, 120, 113, .27);
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(107, 34, 46, .18), rgba(15, 26, 43, .74));
}

.sentiment-warning-settings-head,
.sentiment-warning-region-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sentiment-warning-settings-head strong { color: #ffe5e1; font-size: 14px; }
.sentiment-warning-settings-head span { color: #c69c9a; font-size: 11px; }
.sentiment-warning-region-head { margin-top: 14px; color: #dbeaf4; font-size: 12px; }
.sentiment-warning-region-head button { margin-left: 10px; color: #8ce7ff; font-size: 11px; }
.sentiment-warning-region-head button:hover { color: #fff; }

.sentiment-warning-region-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
    max-height: 180px;
    margin-top: 9px;
    padding: 9px;
    overflow: auto;
    border: 1px solid rgba(255, 160, 149, .13);
    border-radius: 8px;
    background: rgba(3, 10, 21, .32);
}

.sentiment-warning-region-option {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    color: #b9ccd8;
    font-size: 11px;
    white-space: nowrap;
}

.sentiment-warning-region-option input { accent-color: #ff6f70; }
.sentiment-warning-rule-note { margin: 10px 0 0; color: #bfa5a5; font-size: 11px; line-height: 1.55; }

.sentiment-warning-modal { border-color: rgba(255, 122, 115, .46); }
.sentiment-warning-toast { top: 102px; border-color: rgba(255, 151, 104, .62); background: linear-gradient(105deg, rgba(107, 47, 29, .97), rgba(44, 28, 35, .97)); }

.sentiment-warning-detail {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
    gap: 10px;
    align-items: center;
    padding: 15px;
}

.sentiment-warning-value { min-width: 0; }
.sentiment-warning-value span { display: block; color: #879eb0; font-size: 10px; }
.sentiment-warning-value strong { display: block; margin-top: 4px; color: #fff2ef; font-size: 13px; white-space: nowrap; }
.sentiment-warning-value:nth-child(2) strong { color: #ffad9f; }
.sentiment-warning-samples { grid-column: 1 / -2; color: #91a8b8; font-size: 11px; }

/* ==================== 预警溯源 ==================== */
.warning-trace-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2100;
    background: rgba(2, 7, 15, 0.76);
    backdrop-filter: blur(4px);
}

.warning-trace-modal {
    position: fixed;
    z-index: 2101;
    top: 50%;
    left: 50%;
    width: min(980px, calc(100vw - 40px));
    max-height: min(820px, calc(100vh - 44px));
    transform: translate(-50%, -50%);
    overflow: hidden auto;
    border: 1px solid rgba(255, 134, 127, 0.38);
    border-radius: 16px;
    background: linear-gradient(150deg, #18243a 0%, #0d1728 52%, #0b1322 100%);
    box-shadow: 0 28px 82px rgba(0, 0, 0, 0.6), 0 0 35px rgba(255, 92, 104, 0.12);
}

.warning-trace-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 21px 24px 17px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(90deg, rgba(255, 89, 105, 0.11), rgba(255, 174, 83, 0.035));
}

.warning-trace-eyebrow {
    color: #ffb4a6;
    font-size: 11px;
    letter-spacing: 0.08em;
}

.warning-trace-header h2 {
    margin: 5px 0 4px;
    color: #fff;
    font-size: 22px;
}

.warning-trace-header p {
    margin: 0;
    color: var(--text-soft);
    font-size: 12px;
}

.warning-trace-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 16px 24px 0;
}

.warning-trace-kpi {
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.025);
}

.warning-trace-kpi span { display: block; color: var(--text-dim); font-size: 11px; }
.warning-trace-kpi strong { display: block; margin-top: 5px; color: #fff; font-size: 20px; }
.warning-trace-kpi.alert strong { color: #ff8e89; }

.warning-trace-method {
    margin: 14px 24px 0;
    padding: 11px 13px;
    border-left: 3px solid #ffb24c;
    border-radius: 7px;
    color: #b9cad7;
    background: rgba(255, 178, 76, 0.06);
    font-size: 12px;
    line-height: 1.65;
}

.warning-trace-list {
    display: grid;
    gap: 12px;
    padding: 16px 24px 24px;
}

.warning-trace-region {
    overflow: hidden;
    border: 1px solid rgba(255, 126, 121, 0.22);
    border-radius: 12px;
    background: rgba(5, 12, 24, 0.44);
}

.warning-trace-region-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.warning-trace-region-head h3 { margin: 0; color: #f9fbff; font-size: 16px; }
.warning-trace-region-head span { color: #ffb2a7; font-size: 12px; }

.warning-trace-trigger {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr) 102px;
    gap: 14px;
    align-items: center;
    padding: 13px 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.055);
}

.warning-source-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 9px;
    border-radius: 999px;
    color: #fff4ef;
    border: 1px solid rgba(255, 141, 130, 0.4);
    background: rgba(255, 92, 104, 0.13);
    font-size: 12px;
    font-weight: 700;
}

.warning-trace-detail { min-width: 0; }
.warning-trace-detail strong { color: #edf6ff; font-size: 13px; }
.warning-trace-detail p { margin: 4px 0 0; color: #9db1c2; font-size: 11px; line-height: 1.55; }

.warning-trace-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 10px;
    margin-top: 7px;
    color: #c9d8e4;
    font-size: 11px;
}

.warning-trace-metrics b { color: #fff; font-weight: 700; }

.warning-map-jump {
    height: 30px;
    border: 1px solid rgba(0, 212, 255, 0.32);
    border-radius: 7px;
    color: #b9f4ff;
    background: rgba(0, 180, 255, 0.09);
    font-size: 11px;
}

.warning-map-jump:hover { color: #fff; border-color: rgba(0, 212, 255, 0.7); background: rgba(0, 180, 255, 0.18); }

.warning-driver-line {
    grid-column: 2 / -1;
    margin-top: -7px;
    color: #8ea5b7;
    font-size: 11px;
}

.warning-driver-line b { color: #ffd48e; font-weight: 700; }

.warning-trace-empty {
    padding: 42px 18px;
    border: 1px dashed rgba(255, 255, 255, 0.16);
    border-radius: 10px;
    color: var(--text-dim);
    text-align: center;
    font-size: 13px;
}

.warning-auto-toast {
    position: fixed;
    z-index: 2200;
    right: 26px;
    top: 22px;
    display: grid;
    grid-template-columns: 34px minmax(190px, 1fr) auto auto;
    gap: 10px;
    align-items: center;
    width: min(510px, calc(100vw - 38px));
    padding: 12px 13px;
    border: 1px solid rgba(255, 109, 108, 0.6);
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(105deg, rgba(102, 25, 37, 0.97), rgba(37, 23, 34, 0.97));
    box-shadow: 0 14px 38px rgba(0, 0, 0, 0.42), 0 0 24px rgba(255, 71, 88, 0.22);
    animation: warning-toast-in 260ms ease-out;
}

.warning-auto-toast-icon {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff6ef;
    background: #ed4d5f;
    box-shadow: 0 0 14px rgba(255, 76, 93, 0.46);
    font-size: 19px;
    font-weight: 800;
}

.warning-auto-toast-copy { min-width: 0; }
.warning-auto-toast-copy strong { display: block; color: #fff7f6; font-size: 13px; }
.warning-auto-toast-copy span { display: block; margin-top: 3px; overflow: hidden; color: #ffd3cf; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

.warning-auto-toast-open,
.warning-auto-toast-close {
    height: 28px;
    border-radius: 6px;
    font-size: 11px;
}

.warning-auto-toast-open {
    padding: 0 9px;
    border: 1px solid rgba(255, 237, 234, 0.4);
    color: #fff;
    background: rgba(255, 255, 255, 0.11);
}

.warning-auto-toast-close {
    width: 28px;
    padding: 0;
    color: #ffd1cd;
    background: transparent;
}

@keyframes warning-toast-in {
    from { opacity: 0; transform: translateY(-12px) translateX(8px); }
    to { opacity: 1; transform: translateY(0) translateX(0); }
}

@media (max-width: 760px) {
    .warning-trace-summary { grid-template-columns: 1fr; }
    .warning-trace-trigger { grid-template-columns: 92px minmax(0, 1fr); }
    .warning-map-jump { grid-column: 2; width: 102px; }
    .warning-driver-line { grid-column: 1 / -1; margin-top: 0; }
    .warning-auto-toast { right: 12px; top: 12px; grid-template-columns: 32px minmax(0, 1fr) auto auto; }
}

.sentiment-setting-row {
    margin-top: 13px;
    display: grid;
    grid-template-columns: 150px 1fr;
    align-items: center;
    gap: 14px;
    color: #cce2ef;
    font-size: 13px;
}

.sentiment-setting-row .setting-input,
.sentiment-setting-row .setting-select {
    width: 100%;
}

.sentiment-settings-example {
    margin-top: 16px;
    color: var(--text-dim);
}

@media (max-width: 1500px) {
    .sentiment-dashboard-grid {
        grid-template-columns: minmax(220px, .75fr) minmax(430px, 1.45fr) minmax(350px, 1.15fr);
    }

    .sentiment-map-chart,
    .sentiment-trend-chart {
        height: 400px;
    }

    .sentiment-gauge-chart { height: 215px; }
    .sentiment-donut-chart { height: 185px; }
}

@media (max-width: 1200px) {
    .sentiment-dashboard-grid {
        grid-template-columns: 1fr 1.55fr;
    }

    .sentiment-trend-card {
        grid-column: 1 / -1;
    }

    .sentiment-summary-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1050px) {
    .sentiment-evolution-bar { grid-template-columns: auto 1fr auto; }
    .sentiment-evolution-slider-wrap { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
    .sentiment-warning-card { min-width: 160px; }
    .sentiment-warning-region-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .sentiment-warning-detail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sentiment-warning-samples { grid-column: 1 / -1; }
}
