:root {
    --bg: #f0f9ff;
    --surface: #ffffff;
    --surface-hover: #e0f2fe;
    --border: #bae6fd;
    --text: #0c4a6e;
    --text-muted: #0369a1;
    --primary: #0ea5e9;
    --primary-hover: #0284c7;
    --primary-soft: rgba(14, 165, 233, 0.1);
    --primary-medium: rgba(14, 165, 233, 0.18);
    --primary-ring: rgba(14, 165, 233, 0.15);
    --primary-border: rgba(14, 165, 233, 0.45);
    --primary-glow-sm: rgba(14, 165, 233, 0.3);
    --primary-glow-md: rgba(14, 165, 233, 0.5);
    --primary-glow-lg: rgba(14, 165, 233, 0.15);
    --primary-strong: rgba(14, 165, 233, 0.85);
    --placeholder: rgba(3, 105, 161, 0.45);
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --info: #0284c7;
    --purple: #7c3aed;
    --radius: 10px;
    --shadow: 0 4px 24px rgba(14, 165, 233, 0.12);
    --shadow-lg: 0 12px 40px rgba(14, 165, 233, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: #ffffff;
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.app {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
}

.header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header h1 .logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.site-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.status-bar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 6px 14px;
    background: var(--surface);
    border-radius: 20px;
    border: 1px solid var(--border);
}

.connection-status .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.connection-status.connected .dot {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: pulse 2s infinite;
}

.connection-status.disconnected .dot {
    background: var(--danger);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: border-color 0.2s;
}

.stat-card:hover {
    border-color: var(--primary);
}

.stat-card .label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.stat-card .value {
    font-size: 1.8rem;
    font-weight: 700;
}

.stat-card .value.primary { color: var(--primary); }
.stat-card .value.success { color: var(--success); }
.stat-card .value.warning { color: var(--warning); }
.stat-card .value.info { color: var(--info); }

/* Webhook info */
.webhook-info {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.webhook-info .label {
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.webhook-info code {
    background: var(--bg);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--info);
    flex: 1;
    min-width: 200px;
    word-break: break-all;
}

.webhook-info .copy-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    white-space: nowrap;
}

.webhook-info .copy-btn:hover {
    background: var(--primary-hover);
}

/* Push settings */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 24px;
}

.panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

.panel-header h2 {
    font-size: 1rem;
    font-weight: 600;
}

.panel-hint {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.panel-body {
    padding: 16px 20px 20px;
}

.toggle-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    line-height: 1.5;
    cursor: pointer;
    user-select: none;
}

.toggle-row > span {
    flex: 1;
    padding-top: 1px;
    color: var(--text);
}

.toggle-row input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    margin: 0;
    border: 2px solid var(--border);
    border-radius: 7px;
    background: var(--surface);
    cursor: pointer;
    position: relative;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.15s;
}

.toggle-row input[type="checkbox"]:hover {
    border-color: var(--primary);
    background: var(--surface-hover);
}

.toggle-row input[type="checkbox"]:checked {
    background: linear-gradient(135deg, var(--primary), #38bdf8);
    border-color: var(--primary);
    box-shadow: 0 2px 10px var(--primary-glow-sm);
}

.toggle-row input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg) scale(0);
    animation: checkPop 0.2s ease forwards;
}

.toggle-row input[type="checkbox"]:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-ring);
}

.toggle-row input[type="checkbox"]:checked:focus-visible {
    box-shadow: 0 2px 10px var(--primary-glow-sm), 0 0 0 3px var(--primary-ring);
}

@keyframes checkPop {
    from { transform: rotate(45deg) scale(0); opacity: 0; }
    to { transform: rotate(45deg) scale(1); opacity: 1; }
}

.push-profit-range {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: -4px 0 16px 34px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
}

.push-profit-range.hidden {
    display: none;
}

.push-profit-label,
.push-profit-sep {
    color: var(--text-muted);
    font-size: 0.85rem;
    white-space: nowrap;
}

.push-profit-hint {
    flex: 1 1 220px;
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.4;
}

.push-input-wrap--profit {
    flex: 0 0 auto;
    min-width: 88px;
    width: 88px;
}

.push-add-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.push-input-wrap {
    flex: 1;
    min-width: 180px;
    height: 40px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.push-input-wrap--id {
    min-width: 200px;
}

.push-input-wrap--price {
    flex: 0 1 200px;
    min-width: 168px;
}

.push-input-wrap--price .push-input-prefix {
    color: var(--primary);
    min-width: 18px;
    text-align: center;
}

.push-input-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-ring);
}

.push-input-prefix {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    margin-right: 4px;
}

.push-input-wrap input[type="number"] {
    flex: 1;
    height: 100%;
    background: transparent;
    border: none;
    color: var(--text);
    padding: 0;
    font-size: 0.9rem;
    outline: none;
}

.push-input-wrap input[type="text"] {
    flex: 1;
    height: 100%;
    background: transparent;
    border: none;
    color: var(--text);
    padding: 0;
    font-size: 0.9rem;
    outline: none;
}

.push-input-wrap input[type="number"]::-webkit-outer-spin-button,
.push-input-wrap input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.btn-lookup-product {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    box-sizing: border-box;
    padding: 0 18px;
    border-radius: 10px;
    border: 1px solid var(--primary);
    background: var(--surface);
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.btn-lookup-product:hover {
    background: var(--surface-hover);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.btn-lookup-product:active {
    transform: scale(0.98);
}

.btn-add-product {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 40px;
    box-sizing: border-box;
    background: linear-gradient(135deg, var(--primary), #38bdf8);
    color: #fff;
    border: none;
    padding: 0 18px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s;
    white-space: nowrap;
}

.btn-add-product:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--primary-glow-sm);
}

.btn-add-product:active {
    transform: translateY(0);
}

.push-save-status {
    font-size: 0.82rem;
    color: var(--text-muted);
    min-width: 72px;
}

.push-save-status.saving {
    color: var(--warning);
}

.push-save-status.saved {
    color: var(--success);
}

.push-save-status.error {
    color: var(--danger);
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #fff;
}

.product-change-panel {
    margin-top: 28px;
}

.product-change-body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.change-stats-section {
    min-width: 0;
}

.change-stats-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 10px;
}

.change-stats-table-wrap {
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: var(--surface);
}

.change-stats-empty {
    padding: 28px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.change-stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.change-stats-table thead {
    background: var(--bg);
}

.change-stats-table th,
.change-stats-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid rgba(186, 230, 253, 0.6);
}

.change-stats-table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.82rem;
}

.change-stats-table tbody tr:last-child td {
    border-bottom: none;
}

.change-stats-table tbody tr:hover {
    background: var(--surface-hover);
}

.change-stats-table .col-id {
    color: var(--info);
    font-weight: 600;
    white-space: nowrap;
    width: 96px;
}

.change-stats-table .col-name {
    color: var(--text);
    max-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.change-stats-table .col-count {
    color: var(--primary);
    font-weight: 700;
    text-align: center;
    width: 80px;
}

.change-stats-table th:last-child,
.change-stats-table .col-count {
    text-align: center;
}

.push-product-preview {
    margin: -4px 0 12px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    font-size: 0.88rem;
}

.push-product-preview.hidden {
    display: none;
}

.push-product-preview .preview-main {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.push-product-preview .preview-id {
    color: var(--info);
    font-weight: 700;
}

.push-product-preview .preview-name {
    color: var(--text);
    font-weight: 600;
}

.push-product-preview .preview-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.push-product-preview .preview-source {
    color: var(--primary);
}

.push-product-preview .preview-loading {
    color: var(--text-muted);
}

.push-product-preview .preview-error {
    color: var(--danger);
}

.push-section {
    margin-top: 16px;
}

.push-section-title {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.push-product-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.push-empty {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.product-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    max-width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 10px 8px 12px;
    font-size: 0.85rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.product-chip:hover {
    border-color: var(--primary-border);
}

.chip-main {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
}

.product-chip .id {
    color: var(--info);
    font-weight: 600;
    flex-shrink: 0;
    white-space: nowrap;
}

.product-chip .name {
    color: var(--text-muted);
    line-height: 1.4;
    word-break: break-word;
}

.chip-price {
    display: inline-flex;
    align-items: stretch;
    height: 28px;
    box-sizing: border-box;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 7px;
    overflow: hidden;
    flex-shrink: 0;
    cursor: text;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.chip-price:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
    background: var(--surface);
}

.chip-price-prefix {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    padding: 0 6px;
    background: var(--surface-hover);
    border-right: 1px solid var(--border);
    color: var(--primary);
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.chip-price-input {
    width: auto;
    min-width: 2.8em;
    max-width: 6em;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 0.84rem;
    font-weight: 600;
    outline: none;
    padding: 0 6px;
    text-align: left;
    field-sizing: content;
}

.chip-price-input::placeholder {
    color: var(--placeholder);
    font-weight: 400;
}

.chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.15rem;
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s;
}

.chip-remove:hover {
    background: rgba(220, 38, 38, 0.1);
    color: var(--danger);
}

/* Filters */
.filters {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.custom-select {
    position: relative;
    min-width: 148px;
}

.custom-select-native {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.custom-select-trigger {
    appearance: none;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.custom-select-trigger:hover {
    border-color: var(--primary-border);
    background: var(--surface-hover);
}

.custom-select.is-open .custom-select-trigger {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.custom-select-arrow {
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.2s, border-color 0.2s;
    flex-shrink: 0;
}

.custom-select.is-open .custom-select-arrow {
    transform: rotate(-135deg) translateY(-2px);
    border-color: var(--primary);
}

.custom-select-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    max-height: 320px;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 6px;
    z-index: 100;
    box-shadow: var(--shadow-lg);
    animation: dropdownIn 0.15s ease;
    box-sizing: border-box;
}

.custom-select.is-open .custom-select-menu {
    display: block;
}

@keyframes dropdownIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.custom-select-option {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    color: var(--text);
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.custom-select-option:hover {
    background: var(--primary-soft);
    color: var(--primary-hover);
}

.custom-select-option.is-selected {
    background: var(--primary-medium);
    color: var(--primary-hover);
    font-weight: 600;
}

.custom-select-option.is-selected::before {
    content: '✓ ';
    opacity: 0.8;
}

.custom-select-menu::-webkit-scrollbar {
    width: 6px;
}

.custom-select-menu::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.filter-input {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    min-width: 220px;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.filter-input::placeholder {
    color: var(--placeholder);
}

.filter-input:hover {
    border-color: var(--primary-border);
    background: var(--surface-hover);
}

.filter-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.filter-input:-webkit-autofill,
.filter-input:-webkit-autofill:hover,
.filter-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px var(--surface) inset !important;
    -webkit-text-fill-color: var(--text) !important;
}

.filters .btn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.filters .btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filters .btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Notification list */
.notification-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notification-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 16px;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    animation: slideIn 0.3s ease;
}

.notification-item:hover {
    background: var(--surface-hover);
    border-color: var(--primary);
}

.notification-item.new {
    border-color: var(--primary-border);
    box-shadow:
        0 0 0 1px var(--primary-border),
        0 0 14px var(--primary-glow-sm),
        0 0 28px var(--primary-glow-lg);
    animation: slideIn 0.3s ease, newGlow 1.2s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes newGlow {
    0% {
        border-color: var(--primary-strong);
        box-shadow:
            0 0 0 1px var(--primary-glow-md),
            0 0 22px var(--primary-glow-sm),
            0 0 44px var(--primary-glow-lg);
        background: var(--primary-soft);
    }
    100% {
        border-color: var(--primary-border);
        box-shadow:
            0 0 0 1px var(--primary-border),
            0 0 14px var(--primary-glow-sm),
            0 0 28px var(--primary-glow-lg);
        background: var(--surface);
    }
}

.notification-item .badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-product_configured { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.badge-product_deleted { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.badge-stock_changed { background: rgba(6, 182, 212, 0.15); color: var(--info); }
.badge-supply_changed { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.badge-hold_changed { background: rgba(168, 85, 247, 0.15); color: var(--purple); }
.badge-price_changed { background: var(--primary-soft); color: var(--primary); }
.badge-time_limit_enabled,
.badge-time_limit_disabled,
.badge-time_limit_changed { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.badge-order { background: var(--primary-soft); color: var(--primary); }

.notification-item .content {
    min-width: 0;
}

.notification-item .title {
    font-weight: 600;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.notification-item .title .product-id {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.85rem;
}

.notification-item .summary {
    font-size: 0.85rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notification-item .meta {
    text-align: right;
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.notification-item .meta .time {
    display: block;
    margin-bottom: 4px;
}

.notification-item .meta .sign-badge {
    font-size: 0.72rem;
    padding: 2px 6px;
    border-radius: 4px;
}

.sign-valid { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.sign-invalid { background: rgba(239, 68, 68, 0.15); color: var(--danger); }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state .icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1rem;
    margin-bottom: 8px;
}

.empty-state .hint {
    font-size: 0.85rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
}

.pagination button {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
}

.pagination button:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination .page-info {
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 0 12px;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(12, 74, 110, 0.25);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    max-width: 700px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--surface);
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
    padding-right: 12px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    line-height: 1;
    transition: color 0.2s, background 0.2s;
}

.modal-close:hover {
    color: var(--text);
    background: var(--bg);
}

.modal-body {
    padding: 20px 24px 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: transparent;
    margin: 6px 0;
}

.modal-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 999px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.detail-grid {
    display: grid;
    gap: 0;
}

.detail-row {
    display: grid;
    grid-template-columns: 112px 1fr;
    gap: 12px;
    font-size: 0.9rem;
    padding: 12px 0;
    border-bottom: 1px solid rgba(186, 230, 253, 0.6);
}

.detail-row:first-child {
    padding-top: 0;
}

.detail-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
    grid-template-columns: 1fr;
    gap: 10px;
}

.detail-row .key {
    color: var(--text-muted);
    font-weight: 500;
    flex-shrink: 0;
}

.detail-row .value {
    word-break: break-all;
    color: var(--text);
}

.detail-row pre {
    display: block;
    width: 100%;
    margin: 0;
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 0.82rem;
    line-height: 1.55;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    box-sizing: border-box;
}

/* Toast */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--surface);
    border: 1px solid var(--primary);
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 0.9rem;
    box-shadow: var(--shadow);
    animation: toastIn 0.3s ease;
    max-width: 360px;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Login page */
.login-page {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.login-bg {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 10%, rgba(14, 165, 233, 0.25), transparent),
        radial-gradient(ellipse 60% 50% at 80% 80%, rgba(56, 189, 248, 0.2), transparent),
        linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
    z-index: 0;
}

.login-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(14, 165, 233, 0.12) 1px, transparent 1px);
    background-size: 24px 24px;
}

.login-wrap {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 40px 36px;
    box-shadow: var(--shadow-lg);
    animation: loginFadeIn 0.5s ease;
}

@keyframes loginFadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
}

.login-logo {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.login-brand-text h1 {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 4px;
}

.login-brand-text p {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.login-error {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: var(--danger);
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 0.88rem;
    margin-bottom: 20px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-field label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 500;
}

.login-input-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-input-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.login-input-box svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.login-input-box input {
    flex: 1;
    width: 100%;
    min-width: 0;
    background: transparent !important;
    background-color: transparent !important;
    border: none;
    box-shadow: none;
    color: var(--text);
    padding: 12px 0;
    font-size: 0.95rem;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.login-input-box input::placeholder {
    color: var(--placeholder);
}

/* 覆盖浏览器自动填充的白色/黄色背景 */
.login-input-box input:-webkit-autofill,
.login-input-box input:-webkit-autofill:hover,
.login-input-box input:-webkit-autofill:focus,
.login-input-box input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px var(--bg) inset !important;
    box-shadow: 0 0 0 1000px var(--bg) inset !important;
    -webkit-text-fill-color: var(--text) !important;
    caret-color: var(--text);
    transition: background-color 99999s ease-out 0s;
}

.login-remember {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

.login-remember input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    margin: 0;
    border: 2px solid var(--border);
    border-radius: 5px;
    background: var(--surface);
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: border-color 0.2s, background 0.2s;
}

.login-remember input[type="checkbox"]:checked {
    background: linear-gradient(135deg, var(--primary), #38bdf8);
    border-color: var(--primary);
}

.login-remember input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.login-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 4px;
    padding: 13px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), #38bdf8);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s;
}

.login-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px var(--primary-glow-sm);
}

.login-submit:active {
    transform: translateY(0);
}

.login-footer {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 24px;
}

.header .btn {
    appearance: none;
    -webkit-appearance: none;
    box-sizing: border-box;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-family: inherit;
    font-weight: 500;
    line-height: 1.4;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    white-space: nowrap;
}

.header .btn:hover {
    background: var(--surface-hover);
    border-color: var(--primary);
    color: var(--text);
}

.header .btn-refresh:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.header .btn-logout:hover {
    border-color: rgba(239, 68, 68, 0.5);
    color: var(--danger);
    background: rgba(239, 68, 68, 0.08);
}

.header .btn:active {
    transform: scale(0.97);
}

/* Responsive */
@media (max-width: 768px) {
    .notification-item {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .notification-item .meta {
        text-align: left;
        display: flex;
        gap: 12px;
        align-items: center;
    }

    .detail-row {
        grid-template-columns: 1fr;
    }
}
