/* ============ 基础 ============ */
* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
        "Microsoft YaHei", system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ============ 首页 ============ */
body.home {
    min-height: 100vh;
    color: #fff;
    background: #0b0e13 url("../src/background-image.jpg") center center / cover no-repeat fixed;
}

body.home.bg-custom {
    background-image: none;
}

body.home::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(120% 80% at 50% 0%, rgba(6, 9, 15, 0.08), rgba(6, 9, 15, 0.3) 100%),
        linear-gradient(180deg, rgba(6, 9, 15, 0.3) 0%, rgba(6, 9, 15, 0.04) 38%, rgba(6, 9, 15, 0.38) 100%);
    pointer-events: none;
}

.page {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: clamp(44px, 9vh, 110px) 24px 80px;
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.clock {
    text-align: center;
    animation: rise 0.55s ease both;
}

.time {
    font-size: clamp(58px, 7.6vw, 92px);
    font-weight: 600;
    line-height: 1.02;
    letter-spacing: 0.03em;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 8px 34px rgba(0, 0, 0, 0.45);
}

.date {
    margin-top: 12px;
    font-size: 17px;
    letter-spacing: 0.14em;
    color: rgba(255, 255, 255, 0.88);
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.55);
    min-height: 24px;
}

/* 搜索框 */
.search {
    position: relative;
    z-index: 20;
    width: min(520px, 100%);
    height: 48px;
    margin-top: clamp(26px, 4.4vh, 46px);
    display: flex;
    align-items: center;
    padding: 0 7px;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.13);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(16px) saturate(130%);
    -webkit-backdrop-filter: blur(16px) saturate(130%);
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    animation: rise 0.65s ease both;
}

.search:focus-within {
    background: rgba(255, 255, 255, 0.19);
    border-color: rgba(255, 255, 255, 0.36);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.search input {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0 10px;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 15px;
    font-family: inherit;
    outline: none;
}

.search input::placeholder {
    color: rgba(255, 255, 255, 0.65);
}

.engine-btn,
.search-btn {
    flex: none;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.9);
    background: transparent;
    cursor: pointer;
    transition: background 0.18s ease;
}

.engine-btn {
    background: rgba(255, 255, 255, 0.14);
}

.engine-btn:hover,
.search-btn:hover {
    background: rgba(255, 255, 255, 0.24);
}

.engine-badge {
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
}

.engine-badge img {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    object-fit: contain;
}

.search-btn svg {
    width: 19px;
    height: 19px;
}

/* 引擎下拉 */
.engine-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 20;
    width: 230px;
    max-height: 300px;
    overflow: auto;
    margin: 0;
    padding: 6px;
    list-style: none;
    border-radius: 14px;
    background: rgba(24, 27, 34, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    display: none;
}

.engine-menu.open {
    display: block;
}

.engine-menu li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 9px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
}

.engine-menu li:hover {
    background: rgba(255, 255, 255, 0.1);
}

.engine-menu li.active {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.engine-menu img {
    width: 17px;
    height: 17px;
    border-radius: 4px;
    object-fit: contain;
}

/* 导航图标 */
.links {
    position: relative;
    z-index: 1;
    width: min(1120px, 100%);
    margin-top: clamp(30px, 4.6vh, 50px);
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 24px 6px;
    justify-items: center;
    animation: rise 0.75s ease both;
}

.link {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    padding: 2px 0;
    text-decoration: none;
    color: #fff;
}

.link-icon {
    position: relative;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: #fff;
    display: grid;
    place-items: center;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.32);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.link-icon img {
    position: relative;
    z-index: 1;
    width: 27px;
    height: 27px;
    object-fit: contain;
}

.link-icon::after {
    content: attr(data-letter);
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 18px;
    font-weight: 600;
    color: hsl(var(--h, 220) 55% 46%);
}

.link:hover .link-icon {
    transform: translateY(-4px) scale(1.06);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.42);
}

.link:active .link-icon {
    transform: translateY(-1px) scale(1.02);
}

.link-name {
    max-width: 100%;
    font-size: 12px;
    line-height: 1.2;
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.75);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============ 管理后台（浅色控制台） ============ */
body.admin-body {
    --bg: #f5f6f8;
    --surface: #ffffff;
    --line: #e5e8ec;
    --line-soft: #eef1f4;
    --text: #2b3038;
    --text-2: #5b626c;
    --muted: #8b929c;
    --blue: #2f6fe4;
    --blue-dark: #2560c9;
    --blue-soft: #eaf1fe;
    --red: #df4b4b;
    --green: #26945f;

    min-height: 100vh;
    color: var(--text);
    color-scheme: light;
    background: var(--bg);
    font-size: 13px;
}

body.admin-body ::selection {
    background: var(--blue-soft);
}

body.admin-body a {
    color: inherit;
}

/* 登录 */
.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card {
    width: min(360px, 100%);
    padding: 30px 28px 26px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
    box-shadow: 0 10px 30px rgba(32, 45, 70, 0.06);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 2px;
}

.logo-mark {
    flex: none;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    background: var(--blue);
    color: #fff;
}

.logo-mark svg {
    width: 15px;
    height: 15px;
}

.login-title {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.login-card .muted {
    margin: -4px 0 4px;
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.7;
}

.login-card input {
    height: 36px;
    padding: 0 10px;
    border: 1px solid #dfe3e9;
    border-radius: 3px;
    background: #fff;
    color: var(--text);
    font: inherit;
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-card input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 2px rgba(47, 111, 228, 0.12);
}

.login-card input::placeholder {
    color: #b6bcc5;
}

.login-card .primary-btn {
    height: 36px;
    padding: 0;
    justify-content: center;
    font-size: 13px;
}

.flash {
    margin: 0;
    font-size: 12.5px;
}

.flash.err {
    color: var(--red);
}

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

.back-link {
    font-size: 12.5px;
    color: var(--muted);
    text-decoration: none;
    text-align: center;
}

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

.muted {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.7;
}

/* 顶栏 */
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    height: 56px;
    padding-right: 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.logo {
    flex: none;
    width: 210px;
    height: 100%;
    padding-left: 20px;
    display: flex;
    align-items: center;
    gap: 9px;
    text-decoration: none;
}

.logo-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.02em;
}

.logo-sub {
    padding-top: 2px;
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #a6acb5;
}

.topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 18px;
}

.topbar-right a,
.topbar-right button {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: 12.5px;
    color: var(--text-2);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.15s ease;
}

.topbar-right a:hover,
.topbar-right button:hover {
    color: var(--blue);
}

.topbar-right form {
    margin: 0;
}

.avatar {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--blue-soft);
    color: var(--blue);
    font-size: 12px;
    font-weight: 600;
}

/* 布局 */
.console-body {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    align-items: start;
    min-height: calc(100vh - 56px);
}

.sidebar {
    position: sticky;
    top: 56px;
    height: calc(100vh - 56px);
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 14px 10px;
    background: var(--surface);
    border-right: 1px solid var(--line);
    overflow-y: auto;
}

.menu-label {
    margin: 0 0 8px;
    padding: 0 10px;
    font-size: 11px;
    letter-spacing: 0.06em;
    color: #a6acb5;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 10px;
    border-radius: 4px;
    font-size: 13px;
    color: var(--text-2);
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.menu-item svg {
    flex: none;
    width: 15px;
    height: 15px;
    color: #9aa1ab;
    transition: color 0.15s ease;
}

.menu-item:hover {
    background: #f4f7fd;
    color: var(--blue);
}

.menu-item:hover svg {
    color: var(--blue);
}

.menu-item.active {
    background: var(--blue-soft);
    color: var(--blue);
    font-weight: 500;
}

.menu-item.active svg {
    color: var(--blue);
}

.menu-count {
    margin-left: auto;
    font-size: 11px;
    color: #a6acb5;
    font-variant-numeric: tabular-nums;
}

.menu-item.active .menu-count {
    color: var(--blue);
}

.sidebar-note {
    margin: auto 0 0;
    padding: 12px 10px 4px;
    border-top: 1px solid var(--line-soft);
    font-size: 11.5px;
    line-height: 1.75;
    color: #a6acb5;
}

.main {
    min-width: 0;
    padding: 20px 24px 60px;
}

.page-head {
    margin-bottom: 16px;
}

.page-head h1 {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

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

/* 卡片 */
.card {
    margin-bottom: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 4px;
    overflow: hidden;
    scroll-margin-top: 72px;
}

.card-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line-soft);
}

.card-head h2 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.count {
    font-size: 12px;
    color: var(--muted);
}

.card-head > .primary-btn {
    margin-left: auto;
}

/* 按钮 */
.primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border: 1px solid var(--blue);
    border-radius: 3px;
    background: var(--blue);
    color: #fff;
    font: inherit;
    font-size: 12.5px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.primary-btn:hover {
    background: var(--blue-dark);
    border-color: var(--blue-dark);
}

.ghost-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 12px;
    border: 1px solid #dfe3e9;
    border-radius: 3px;
    background: #fff;
    color: var(--text-2);
    font: inherit;
    font-size: 12.5px;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.ghost-btn:hover {
    border-color: var(--blue);
    color: var(--blue);
}

/* 访问统计 */
.stats-filter {
    margin-left: auto;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.stats-filter input[type="date"] {
    height: 30px;
    padding: 0 8px;
    border: 1px solid #dfe3e9;
    border-radius: 3px;
    background: #fff;
    color: var(--text-2);
    font: inherit;
    font-size: 12.5px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.stats-filter input[type="date"]:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 2px rgba(47, 111, 228, 0.12);
}

.stats-filter .primary-btn {
    margin-left: 0;
}

.stats-clear {
    display: inline-flex;
    align-items: center;
}

.stats-clear .ghost-btn {
    color: var(--red);
    border-color: #f0caca;
}

.stats-clear .ghost-btn:hover {
    color: #fff;
    background: var(--red);
    border-color: var(--red);
}

.stats-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

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

.kpi {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border: 1px solid var(--line-soft);
    border-radius: 4px;
    background: #fbfcfd;
}

.kpi-label {
    font-size: 12px;
    color: var(--muted);
}

.kpi strong {
    font-size: 26px;
    font-weight: 600;
    line-height: 1;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.kpi-sub {
    font-size: 11.5px;
    color: #a6acb5;
}

.kpi.is-today {
    border-color: #d7e3fb;
    background: #f7faff;
}

.kpi.is-today strong {
    color: var(--blue);
}

.geo-block {
    padding-top: 14px;
    border-top: 1px solid var(--line-soft);
}

.geo-head {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.geo-head h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
}

.geo-head span {
    font-size: 12px;
    color: var(--muted);
}

.geo-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.geo-list li {
    display: grid;
    grid-template-columns: minmax(90px, 150px) minmax(0, 1fr) 40px;
    align-items: center;
    gap: 12px;
    font-size: 12.5px;
}

.geo-name {
    color: var(--text-2);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.geo-bar {
    height: 6px;
    border-radius: 3px;
    background: #eef1f5;
    overflow: hidden;
}

.geo-bar i {
    display: block;
    height: 100%;
    min-width: 4px;
    border-radius: 3px;
    background: var(--blue);
}

.geo-count {
    text-align: right;
    color: var(--text-2);
    font-variant-numeric: tabular-nums;
}

.geo-note {
    margin: 10px 0 0;
    font-size: 11.5px;
    color: #a6acb5;
}

.stats-charts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.stats-charts > .card {
    margin-bottom: 0;
    min-width: 0;
}

.geo-chart {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: nowrap;
}

.donut {
    position: relative;
    flex: none;
    width: 150px;
    height: 150px;
    border-radius: 50%;
}

.donut svg {
    display: block;
    width: 100%;
    height: 100%;
}

.donut-seg {
    transition: stroke-width 0.15s ease, opacity 0.15s ease;
}

.donut-seg:hover {
    stroke-width: 19;
    opacity: 0.88;
}

.donut-tip {
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(23, 32, 48, 0.94);
    color: #fff;
    font-size: 12px;
    line-height: 1.5;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, calc(-100% - 12px));
    transition: opacity 0.12s ease;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.22);
}

.donut-tip.show {
    opacity: 1;
}

.donut-center {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.donut-center strong {
    font-size: 20px;
    line-height: 1.1;
    font-weight: 600;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.donut-center span {
    margin-top: 2px;
    font-size: 11px;
    color: var(--muted);
}

.chart-legend {
    flex: 1 1 0;
    min-width: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legend-row {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-2);
}

.legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--c, #cbd5e1);
}

.legend-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.legend-count {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.carrier-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    margin: 14px 0 0;
    font-size: 12px;
    color: var(--text-2);
}

.carrier-summary span {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
}

.carrier-summary strong {
    color: var(--text);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.card-body {
    padding: 16px;
}

.trend-block {
    padding-top: 16px;
    border-top: 1px solid var(--line-soft);
}

.trend-head {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.trend-head h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
}

.trend-head span {
    font-size: 12px;
    color: var(--muted);
}

.trend {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 10px;
    align-items: end;
}

.trend-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.trend-value {
    font-size: 11.5px;
    color: var(--text-2);
    font-variant-numeric: tabular-nums;
}

.trend-track {
    width: 100%;
    height: 88px;
    display: flex;
    align-items: flex-end;
    border-radius: 3px;
    background: #f4f6f9;
    overflow: hidden;
}

.trend-track i {
    display: block;
    width: 100%;
    border-radius: 3px 3px 0 0;
    background: var(--blue);
    transition: background 0.15s ease;
}

.trend-col:hover .trend-track i {
    background: var(--blue-dark);
}

.trend-day {
    font-size: 11px;
    color: var(--muted);
}

.hint-line {
    margin: 0 0 8px;
    font-size: 12.5px;
    line-height: 1.8;
    color: var(--text-2);
}

.hint-line:last-child {
    margin-bottom: 0;
}

.hint-line code {
    padding: 1px 5px;
    border-radius: 3px;
    background: #f2f4f8;
    font-family: Consolas, "SF Mono", Menlo, monospace;
    font-size: 12px;
    color: var(--text);
}

/* 表格行 */
.row {
    display: grid;
    align-items: center;
    gap: 10px;
    padding: 6px 16px;
    border-bottom: 1px solid var(--line-soft);
    transition: background 0.12s ease;
}

.row:last-child {
    border-bottom: 0;
}

.row:hover {
    background: #fbfcfe;
}

.row-nav {
    grid-template-columns: 34px minmax(90px, 1fr) minmax(150px, 1.8fr) minmax(120px, 1.3fr) 128px;
}

.row-engine {
    grid-template-columns: 34px minmax(90px, 1fr) minmax(180px, 2fr) minmax(110px, 1.1fr) 128px;
}

.row-head {
    padding: 9px 16px;
    background: #fafbfc;
    border-bottom: 1px solid var(--line);
    font-size: 12px;
    color: var(--muted);
}

.row-head:hover {
    background: #fafbfc;
}

.ops-head {
    text-align: right;
}

.row input[type="text"] {
    width: 100%;
    min-width: 0;
    height: 30px;
    padding: 0 8px;
    border: 1px solid transparent;
    border-radius: 3px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 12.5px;
    outline: none;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.row:hover input[type="text"] {
    border-color: #e6e9ee;
    background: #fff;
}

.row input::placeholder {
    color: #b6bcc5;
}

.row input[type="text"]:focus {
    border-color: var(--blue);
    background: #fff;
    box-shadow: 0 0 0 2px rgba(47, 111, 228, 0.12);
}

.row input[name$="[url]"] {
    font-size: 12px;
    color: var(--text-2);
}

.ico-cell {
    position: relative;
    width: 26px;
    height: 26px;
    margin: 0 auto;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #fff;
    overflow: hidden;
    font-size: 11px;
    font-weight: 600;
    color: hsl(var(--h, 220) 45% 45%);
}

.ico-cell img {
    position: relative;
    z-index: 1;
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.ico-cell::before {
    content: attr(data-letter);
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
}

.add-icon {
    border: 1px dashed #cfd5dd;
    background: #fbfcfd;
    color: #a6acb5;
}

.radio-cell {
    display: grid;
    place-items: center;
    height: 26px;
}

.radio-cell input {
    width: 14px;
    height: 14px;
    accent-color: var(--blue);
    cursor: pointer;
}

.ops {
    display: flex;
    justify-content: flex-end;
    gap: 2px;
}

.ops button {
    padding: 4px 6px;
    border: 0;
    border-radius: 3px;
    background: transparent;
    color: var(--blue);
    font: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.13s ease, color 0.13s ease;
}

.ops button:hover {
    background: var(--blue-soft);
}

.ops button.danger:hover {
    background: #fdeeee;
    color: var(--red);
}

.ops button.add-btn {
    height: 26px;
    padding: 0 12px;
    background: var(--blue);
    color: #fff;
}

.ops button.add-btn:hover {
    background: var(--blue-dark);
}

.row-new {
    background: #fbfcfd;
    border-top: 1px dashed #e6e9ee;
}

.row-new:hover {
    background: #f7f9fc;
}

/* 设置表单 */
.settings-fields {
    padding: 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 20px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field span {
    font-size: 12px;
    color: var(--text-2);
}

.field input {
    height: 32px;
    padding: 0 10px;
    border: 1px solid #dfe3e9;
    border-radius: 3px;
    background: #fff;
    color: var(--text);
    font: inherit;
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 2px rgba(47, 111, 228, 0.12);
}

.field input::placeholder {
    color: #b6bcc5;
}

.field-check {
    grid-column: 1 / -1;
}

.check-line {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    font-size: 12.5px;
    color: var(--text-2);
    cursor: pointer;
}

.check-line input {
    width: 15px;
    height: 15px;
    accent-color: var(--blue);
    cursor: pointer;
}

.inline-link {
    color: var(--blue);
    text-decoration: none;
}

.inline-link:hover {
    text-decoration: underline;
}

/* 提示与空状态 */
.flash-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 4px;
    font-size: 12.5px;
}

.flash-banner::before {
    content: "";
    flex: none;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.flash-banner.ok {
    background: #f1faf5;
    border-color: #cbe9d9;
    color: #1f7a4f;
}

.flash-banner.err {
    background: #fdf2f2;
    border-color: #f5d2d2;
    color: #b53b3b;
}

.empty {
    margin: 0;
    padding: 22px 16px;
    text-align: center;
    font-size: 12.5px;
    color: var(--muted);
}

.geo-block .empty {
    padding: 10px 0;
    text-align: left;
}

/* ============ 响应式 ============ */
@media (max-width: 980px) {
    .console-body {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 4px;
        padding: 8px 12px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .menu-label,
    .sidebar-note {
        display: none;
    }

    .menu-item {
        padding: 7px 11px;
        white-space: nowrap;
    }

    .menu-count {
        margin-left: 4px;
    }

    .main {
        padding: 16px 14px 50px;
    }

    .logo {
        width: auto;
        padding-left: 14px;
    }

    .topbar {
        padding-right: 14px;
    }

    .topbar-right {
        gap: 12px;
    }
}

@media (max-width: 720px) {
    .page {
        padding: clamp(38px, 7vh, 70px) 18px 72px;
    }

    .links {
        grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
        gap: 20px 4px;
    }

    .time {
        font-size: 56px;
    }

    .date {
        font-size: 14px;
        letter-spacing: 0.08em;
    }

    .logo-sub {
        display: none;
    }

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

    .stats-filter {
        width: 100%;
        margin-left: 0;
    }

    .stats-filter input[type="date"] {
        flex: 1;
        min-width: 0;
    }

    .row-nav,
    .row-engine {
        grid-template-columns: 28px minmax(0, 1fr);
        grid-template-areas:
            "ico name"
            "ico url"
            "ico icon"
            "ops ops";
        gap: 5px;
        padding: 10px 12px;
    }

    .row-head {
        display: none;
    }

    .row-nav .ico-cell,
    .row-engine .ico-cell,
    .row-engine .radio-cell {
        grid-area: ico;
        align-self: start;
    }

    .row-nav input:nth-child(2),
    .row-engine input[name$="[name]"] {
        grid-area: name;
    }

    .row-nav input:nth-child(3),
    .row-engine input[name$="[url]"] {
        grid-area: url;
    }

    .row-nav input:nth-child(4),
    .row-engine input[name$="[icon]"] {
        grid-area: icon;
    }

    .row-nav .ops,
    .row-engine .ops {
        grid-area: ops;
        justify-content: flex-start;
    }

    .row input[type="text"] {
        border-color: #e6e9ee;
        background: #fff;
    }

    .settings-fields {
        grid-template-columns: 1fr;
        padding: 14px;
    }
}

/* 应用分发 */
.dist-switch-form {
    margin: 0;
}

.remote-form {
    margin: 0;
}

.remote-fields {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 14px;
}

.remote-field {
    flex: 1 1 260px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
    color: var(--text-2);
}

.remote-field input {
    width: 100%;
    height: 32px;
    padding: 0 9px;
    border: 1px solid #dfe3e9;
    border-radius: 3px;
    background: #fff;
    color: var(--text);
    font: inherit;
    font-size: 12.5px;
    outline: none;
}

.remote-field input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 2px rgba(47, 111, 228, 0.12);
}

.remote-fields .primary-btn {
    height: 32px;
    padding: 0 16px;
}

.switch {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

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

.switch-track {
    position: relative;
    flex: none;
    width: 46px;
    height: 26px;
    border-radius: 999px;
    background: #d7dce5;
    transition: background 0.18s ease;
}

.switch-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
    transition: transform 0.18s ease;
}

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

.switch input:checked + .switch-track .switch-thumb {
    transform: translateX(20px);
}

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

.switch input:disabled ~ .switch-text {
    color: var(--muted);
}

.switch-text {
    color: var(--text-2);
    font-size: 12.5px;
}

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

.dist-slot {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fbfcfd;
}

.dist-slot h3 {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 600;
}

.dist-path {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.8;
}

.dist-path code,
.dist-note code {
    padding: 1px 5px;
    border-radius: 3px;
    background: #eef1f5;
    font-family: Consolas, "SF Mono", Menlo, monospace;
    font-size: 11.5px;
    color: var(--text);
}

.dist-state {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 12px;
}

.dist-state.ok {
    color: var(--green);
}

.dist-upload {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 8px;
}

.dist-upload input[type="file"] {
    flex: 1 1 150px;
    min-width: 0;
    font-size: 12px;
}

.dist-upload .primary-btn {
    height: 30px;
    padding: 0 12px;
}

.dist-note {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.8;
}

.autoclose-form {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
}

.autoclose-delay {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-2);
}

.autoclose-delay input {
    width: 100px;
    height: 30px;
    padding: 0 8px;
    border: 1px solid #dfe3e9;
    border-radius: 3px;
    background: #fff;
    color: var(--text);
    font: inherit;
    font-size: 13px;
    outline: none;
}

.autoclose-delay input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 2px rgba(47, 111, 228, 0.12);
}

.autoclose-form .primary-btn {
    height: 30px;
    padding: 0 14px;
}

@media (max-width: 900px) {
    .dist-grid {
        grid-template-columns: 1fr;
    }
}
