/* Admin Panel - Light Premium Theme */

:root {
    --adm-bg: #f0f3f8;
    --adm-bg-elevated: #ffffff;
    --adm-sidebar: #ffffff;
    --adm-sidebar-hover: #f5f7fb;
    --adm-surface: #ffffff;
    --adm-surface-2: #f8fafc;
    --adm-surface-hover: #f1f5f9;
    --adm-border: #e4e9f0;
    --adm-border-strong: #d0d9e4;
    --adm-text: #1a2332;
    --adm-text-secondary: #5a6b7f;
    --adm-muted: #8b9bb0;
    --adm-brand: #e8353a;
    --adm-brand-light: #ff4d52;
    --adm-brand-soft: rgba(232, 53, 58, 0.08);
    --adm-brand-glow: rgba(232, 53, 58, 0.22);
    --adm-green: #10b981;
    --adm-green-soft: rgba(16, 185, 129, 0.1);
    --adm-blue: #3b82f6;
    --adm-blue-soft: rgba(59, 130, 246, 0.1);
    --adm-amber: #f59e0b;
    --adm-amber-soft: rgba(245, 158, 11, 0.1);
    --adm-danger: #ef4444;
    --adm-danger-soft: rgba(239, 68, 68, 0.08);
    --adm-radius: 12px;
    --adm-radius-sm: 8px;
    --adm-radius-lg: 16px;
    --adm-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 16px rgba(15, 23, 42, 0.04);
    --adm-shadow-lg: 0 8px 32px rgba(15, 23, 42, 0.1);
    --adm-sidebar-w: 252px;
    --adm-transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body.adm-body {
    font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", -apple-system, sans-serif;
    background: var(--adm-bg);
    color: var(--adm-text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* Layout */
.adm-body { display: flex; min-height: 100vh; }

.adm-sidebar {
    width: var(--adm-sidebar-w);
    background: var(--adm-sidebar);
    border-right: 1px solid var(--adm-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    box-shadow: 2px 0 20px rgba(15, 23, 42, 0.04);
}

.adm-sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 160px;
    background: linear-gradient(180deg, rgba(232, 53, 58, 0.04) 0%, transparent 100%);
    pointer-events: none;
}

.adm-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 18px 20px;
    border-bottom: 1px solid var(--adm-border);
    position: relative;
}

.adm-brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: linear-gradient(145deg, var(--adm-brand-light), var(--adm-brand));
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 16px;
    color: #fff;
    box-shadow: 0 4px 14px var(--adm-brand-glow);
    flex-shrink: 0;
}

.adm-brand strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--adm-text);
}

.adm-brand em {
    font-size: 11px;
    color: var(--adm-muted);
    font-style: normal;
    font-weight: 500;
}

.adm-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
    position: relative;
}

.adm-nav::-webkit-scrollbar { width: 4px; }
.adm-nav::-webkit-scrollbar-thumb { background: var(--adm-border-strong); border-radius: 4px; }

.adm-nav-group { margin-bottom: 18px; }
.adm-nav-group:last-child { margin-bottom: 6px; }

.adm-nav-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--adm-muted);
    padding: 0 10px 8px;
}

.adm-nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 10px;
    border-radius: var(--adm-radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--adm-text-secondary);
    margin-bottom: 3px;
    transition: all var(--adm-transition);
    position: relative;
    border: 1px solid transparent;
}

.adm-nav-item:hover {
    background: var(--adm-sidebar-hover);
    color: var(--adm-text);
}

.adm-nav-item.active {
    background: var(--adm-brand-soft);
    color: var(--adm-brand);
    border-color: rgba(232, 53, 58, 0.12);
}

.adm-nav-item.is-locked {
    opacity: 0.45;
    cursor: not-allowed;
    color: var(--adm-muted);
    user-select: none;
}

.adm-nav-item.is-locked:hover {
    background: transparent;
    color: var(--adm-muted);
}

.adm-nav-lock {
    margin-left: auto;
    font-size: 11px;
    opacity: 0.85;
}

.adm-nav-item.active::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 18px;
    background: var(--adm-brand);
    border-radius: 0 3px 3px 0;
}

.adm-nav-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    background: var(--adm-surface-2);
    border: 1px solid var(--adm-border);
    transition: all var(--adm-transition);
}

.adm-nav-icon svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.7;
}

.adm-nav-item:hover .adm-nav-icon {
    background: #fff;
    border-color: var(--adm-border-strong);
}

.adm-nav-item:hover .adm-nav-icon svg { opacity: 1; }

.adm-nav-item.active .adm-nav-icon {
    background: #fff;
    border-color: rgba(232, 53, 58, 0.2);
    box-shadow: 0 2px 8px var(--adm-brand-glow);
}

.adm-nav-item.active .adm-nav-icon svg {
    opacity: 1;
    stroke: var(--adm-brand);
}

.adm-nav-text { flex: 1; line-height: 1.3; }

.adm-sidebar-foot {
    padding: 12px;
    border-top: 1px solid var(--adm-border);
    background: var(--adm-surface-2);
}

.adm-sidebar-foot .adm-nav-item { font-size: 12px; padding: 8px 10px; }

.adm-nav-item.adm-logout { color: var(--adm-danger); }
.adm-nav-item.adm-logout:hover {
    background: var(--adm-danger-soft);
    color: #dc2626;
}

.adm-nav-item.adm-logout .adm-nav-icon {
    background: var(--adm-danger-soft);
    border-color: rgba(239, 68, 68, 0.15);
}

.adm-main {
    flex: 1;
    margin-left: var(--adm-sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--adm-bg);
}

.adm-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 28px;
    border-bottom: 1px solid var(--adm-border);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.adm-topbar h1 {
    font-size: 17px;
    font-weight: 600;
    color: var(--adm-text);
}

.adm-topbar-right { display: flex; align-items: center; gap: 12px; }

.adm-user-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 500;
    background: var(--adm-surface-2);
    padding: 7px 14px 7px 10px;
    border-radius: 100px;
    border: 1px solid var(--adm-border);
    color: var(--adm-text-secondary);
}

.adm-user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--adm-brand-light), var(--adm-brand));
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
}

.adm-content { padding: 24px 28px 48px; flex: 1; }

/* Cards */
.adm-card {
    background: var(--adm-surface);
    border: 1px solid var(--adm-border);
    border-radius: var(--adm-radius);
    padding: 20px;
    margin-bottom: 18px;
    box-shadow: var(--adm-shadow);
}

.adm-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--adm-border);
}

.adm-card-head h2 {
    font-size: 14px;
    font-weight: 600;
    color: var(--adm-text);
}

.adm-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* Stats */
.adm-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.adm-stat {
    background: var(--adm-surface);
    border: 1px solid var(--adm-border);
    border-radius: var(--adm-radius);
    padding: 18px 20px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--adm-shadow);
    transition: transform var(--adm-transition), box-shadow var(--adm-transition);
}

.adm-stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--adm-brand), #ff8a8e);
}

.adm-stat:hover {
    transform: translateY(-2px);
    box-shadow: var(--adm-shadow-lg);
}

.adm-stat-val {
    font-size: 30px;
    font-weight: 700;
    color: var(--adm-brand);
    letter-spacing: -0.03em;
}

.adm-stat-label {
    font-size: 12px;
    color: var(--adm-muted);
    margin-top: 6px;
    font-weight: 500;
}

/* Module cards */
.adm-module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 12px;
}

.adm-module-card {
    background: var(--adm-surface-2);
    border: 1px solid var(--adm-border);
    border-radius: var(--adm-radius-sm);
    padding: 16px;
    transition: all var(--adm-transition);
}

.adm-module-card:hover {
    background: #fff;
    border-color: var(--adm-border-strong);
    box-shadow: var(--adm-shadow);
}

.adm-module-card h3 { font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--adm-text); }
.adm-module-card p { font-size: 11px; color: var(--adm-muted); line-height: 1.5; }
.adm-module-card .adm-badge { margin-top: 10px; }

/* Tags & badges */
.adm-tag {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 100px;
    background: var(--adm-surface-2);
    color: var(--adm-text-secondary);
    border: 1px solid var(--adm-border);
}

.adm-tag-green { background: var(--adm-green-soft); color: var(--adm-green); border-color: rgba(16, 185, 129, 0.2); }
.adm-tag-red { background: var(--adm-danger-soft); color: var(--adm-danger); border-color: rgba(239, 68, 68, 0.2); }
.adm-tag-blue { background: var(--adm-blue-soft); color: var(--adm-blue); border-color: rgba(59, 130, 246, 0.2); }

.adm-badge {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 100px;
}

.adm-badge-on { background: var(--adm-green-soft); color: var(--adm-green); }
.adm-badge-off { background: var(--adm-danger-soft); color: var(--adm-danger); }

/* Toolbar */
.adm-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding: 14px 16px;
    background: var(--adm-surface);
    border: 1px solid var(--adm-border);
    border-radius: var(--adm-radius);
    box-shadow: var(--adm-shadow);
}

.adm-toolbar-desc {
    flex: 1;
    font-size: 13px;
    color: var(--adm-text-secondary);
    min-width: 200px;
    line-height: 1.5;
}

.adm-toolbar-left { display: flex; align-items: center; gap: 12px; flex: 1; }

/* Buttons */
.adm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid var(--adm-border-strong);
    background: #fff;
    color: var(--adm-text);
    padding: 8px 16px;
    border-radius: var(--adm-radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--adm-transition);
    font-family: inherit;
}

.adm-btn:hover {
    background: var(--adm-surface-2);
    border-color: #b8c5d4;
}

.adm-btn:active { transform: scale(0.98); }

.adm-btn-primary {
    background: linear-gradient(135deg, var(--adm-brand-light), var(--adm-brand));
    border-color: transparent;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 10px var(--adm-brand-glow);
}

.adm-btn-primary:hover {
    filter: brightness(1.05);
    background: linear-gradient(135deg, #ff6166, var(--adm-brand));
}

.adm-btn-sm { padding: 5px 12px; font-size: 12px; }
.adm-btn-block { width: 100%; }
.adm-btn-danger {
    color: var(--adm-danger);
    border-color: rgba(239, 68, 68, 0.25);
    background: var(--adm-danger-soft);
}

.adm-btn-danger:hover {
    background: rgba(239, 68, 68, 0.12);
}

/* Forms */
.adm-form { display: grid; gap: 14px; }
.adm-form-2 { grid-template-columns: 1fr 1fr; }

.adm-field { display: flex; flex-direction: column; gap: 7px; }
.adm-field span { font-size: 12px; font-weight: 500; color: var(--adm-text-secondary); }

.adm-field input,
.adm-field select,
.adm-field textarea {
    background: #fff;
    border: 1px solid var(--adm-border);
    border-radius: var(--adm-radius-sm);
    padding: 10px 13px;
    color: var(--adm-text);
    font-size: 13px;
    font-family: inherit;
    transition: border-color var(--adm-transition), box-shadow var(--adm-transition);
}

.adm-field input:focus,
.adm-field select:focus,
.adm-field textarea:focus {
    outline: none;
    border-color: var(--adm-brand);
    box-shadow: 0 0 0 3px var(--adm-brand-soft);
}

.adm-field-full { grid-column: 1 / -1; }

.adm-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    color: var(--adm-text-secondary);
}

.adm-switch input {
    width: 18px;
    height: 18px;
    accent-color: var(--adm-brand);
    cursor: pointer;
}

.adm-switch-lg { padding: 10px 0; }

/* Tables */
.adm-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--adm-border);
    border-radius: var(--adm-radius-sm);
    background: #fff;
}

.adm-table { width: 100%; border-collapse: collapse; font-size: 12px; }

.adm-table th,
.adm-table td {
    padding: 11px 14px;
    text-align: left;
    border-bottom: 1px solid var(--adm-border);
}

.adm-table th {
    color: var(--adm-muted);
    font-weight: 600;
    font-size: 11px;
    background: var(--adm-surface-2);
}

.adm-table tbody tr:hover td { background: #fafbfd; }
.adm-table tbody tr:last-child td { border-bottom: none; }
.adm-table .actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Tips & guides */
.adm-tip { font-size: 12px; color: var(--adm-muted); margin-top: 10px; line-height: 1.6; }
.adm-tip-box { font-size: 13px; color: var(--adm-text-secondary); line-height: 1.75; }

.adm-guide { display: grid; gap: 10px; }

.adm-guide-item {
    padding: 14px 16px;
    background: var(--adm-surface-2);
    border: 1px solid var(--adm-border);
    border-radius: var(--adm-radius-sm);
}

.adm-guide-item strong { color: var(--adm-blue); font-size: 13px; font-weight: 600; }
.adm-guide-item p { font-size: 12px; color: var(--adm-muted); margin-top: 5px; line-height: 1.55; }

/* Preview */
.adm-preview-label { font-size: 11px; font-weight: 600; color: var(--adm-muted); margin: 14px 0 8px; }
.adm-preview-strip { display: flex; gap: 8px; flex-wrap: wrap; }

.adm-preview-chip {
    background: var(--adm-surface-2);
    border: 1px solid var(--adm-border);
    border-radius: var(--adm-radius-sm);
    padding: 7px 12px;
    font-size: 11px;
    color: var(--adm-text-secondary);
}

/* Carousel */
.adm-carousel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 16px;
}

.adm-carousel-card {
    border-radius: var(--adm-radius);
    overflow: hidden;
    border: 1px solid var(--adm-border);
    background: #fff;
    box-shadow: var(--adm-shadow);
    transition: transform var(--adm-transition), box-shadow var(--adm-transition);
}

.adm-carousel-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--adm-shadow-lg);
}

.adm-carousel-preview { padding: 28px 18px; min-height: 108px; }
.adm-carousel-preview.theme-red { background: linear-gradient(135deg, #ff6b6b, #e8353a); }
.adm-carousel-preview.theme-blue { background: linear-gradient(135deg, #60a5fa, #2563eb); }
.adm-carousel-preview.theme-purple { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.adm-carousel-preview h3 { font-size: 16px; font-weight: 600; color: #fff; }
.adm-carousel-preview p { font-size: 12px; color: rgba(255, 255, 255, 0.9); margin-top: 5px; }

.adm-carousel-meta {
    padding: 14px 16px;
    background: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* List cards */
.adm-list-cards { display: grid; gap: 10px; }

.adm-list-card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 14px 16px;
    background: var(--adm-surface-2);
    border: 1px solid var(--adm-border);
    border-radius: var(--adm-radius-sm);
    font-size: 12px;
}

.adm-list-card:hover { border-color: var(--adm-border-strong); background: #fff; }

/* Quant */
.adm-quant-cats { display: grid; gap: 16px; }

.adm-quant-cat {
    border: 1px solid var(--adm-border);
    border-radius: var(--adm-radius);
    overflow: hidden;
    background: #fff;
    box-shadow: var(--adm-shadow);
}

.adm-quant-cat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--adm-surface-2);
    border-bottom: 1px solid var(--adm-border);
}

.adm-quant-cat-head h3 { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.adm-module-hint { margin-bottom: 16px; }

/* Modal */
.adm-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(4px);
    display: grid;
    place-items: center;
    z-index: 300;
    padding: 24px;
}

.adm-modal[hidden] { display: none; }

.adm-modal-box {
    background: #fff;
    border: 1px solid var(--adm-border);
    border-radius: var(--adm-radius-lg);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--adm-shadow-lg);
}

.adm-modal-lg { max-width: 640px; }

.adm-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid var(--adm-border);
}

.adm-modal-head h3 { font-size: 15px; font-weight: 600; }

.adm-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--adm-surface-2);
    border: 1px solid var(--adm-border);
    color: var(--adm-muted);
    font-size: 18px;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: all var(--adm-transition);
}

.adm-modal-close:hover { background: var(--adm-danger-soft); color: var(--adm-danger); }

.adm-modal-box .adm-form { padding: 18px 20px; }

.adm-modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--adm-border);
    background: var(--adm-surface-2);
}

/* Toast — 顶部居中，避免右下角遮挡操作 */
.adm-toast {
    position: fixed;
    top: 72px;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translateX(-50%) translateY(-12px);
    background: #fff;
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--adm-green);
    padding: 12px 20px;
    border-radius: var(--adm-radius-sm);
    font-size: 13px;
    font-weight: 500;
    opacity: 0;
    transition: 0.3s ease;
    z-index: 300;
    pointer-events: none;
    box-shadow: var(--adm-shadow-lg);
    max-width: min(520px, calc(100vw - 48px));
    text-align: center;
}

.adm-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 引擎页内联提示已弃用，统一走居中弹窗 */
.adm-engine-notice-wrap {
    display: none !important;
}

.adm-engine-notice-inner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--adm-border);
    background: #fff;
    box-shadow: var(--adm-shadow);
    animation: adm-notice-in 0.22s ease;
}

@keyframes adm-notice-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: none; }
}

.adm-engine-notice-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 14px;
    font-weight: 700;
}

.adm-engine-notice-content { flex: 1; min-width: 0; }

.adm-engine-notice-title {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--adm-text);
}

.adm-engine-notice-msg {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--adm-text-secondary);
    white-space: pre-line;
}

.adm-engine-notice-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.adm-engine-notice-stat {
    min-width: 72px;
    padding: 6px 10px;
    border-radius: 8px;
    background: var(--adm-surface-2);
    text-align: center;
}

.adm-engine-notice-stat-val {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: var(--adm-text);
}

.adm-engine-notice-stat-label {
    display: block;
    font-size: 11px;
    color: var(--adm-muted);
    margin-top: 2px;
}

.adm-engine-notice-close {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--adm-muted);
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
}

.adm-engine-notice-close:hover { background: var(--adm-surface-2); color: var(--adm-text); }

.adm-engine-notice-success { border-color: rgba(16, 185, 129, 0.35); background: rgba(16, 185, 129, 0.06); }
.adm-engine-notice-success .adm-engine-notice-icon { background: rgba(16, 185, 129, 0.15); color: var(--adm-green); }

.adm-engine-notice-error { border-color: rgba(239, 68, 68, 0.35); background: rgba(239, 68, 68, 0.05); }
.adm-engine-notice-error .adm-engine-notice-icon { background: rgba(239, 68, 68, 0.12); color: var(--adm-danger); }

.adm-engine-notice-warn { border-color: rgba(245, 158, 11, 0.4); background: rgba(245, 158, 11, 0.08); }
.adm-engine-notice-warn .adm-engine-notice-icon { background: rgba(245, 158, 11, 0.15); color: #b45309; }

.adm-engine-notice-info { border-color: rgba(59, 130, 246, 0.35); background: rgba(59, 130, 246, 0.05); }
.adm-engine-notice-info .adm-engine-notice-icon { background: rgba(59, 130, 246, 0.12); color: var(--adm-primary, #3b82f6); }

/* Confirm / Result modals */
.adm-modal-confirm,
.adm-modal-result {
    max-width: 420px;
    padding: 28px 24px 22px;
    text-align: center;
}

.adm-confirm-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: #fff7ed;
    color: #ea580c;
    font-size: 24px;
    font-weight: 700;
    display: grid;
    place-items: center;
    border: 1px solid #fed7aa;
}

.adm-confirm-title,
.adm-result-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--adm-text);
    margin-bottom: 8px;
}

.adm-confirm-msg,
.adm-result-msg {
    font-size: 13px;
    color: var(--adm-muted);
    line-height: 1.6;
    margin-bottom: 20px;
    white-space: pre-line;
}

.adm-confirm-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.adm-result-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    border-radius: 50%;
    font-size: 26px;
    font-weight: 700;
    display: grid;
    place-items: center;
}

.adm-result-icon.success {
    background: var(--adm-green-soft);
    color: var(--adm-green);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.adm-result-icon.error {
    background: var(--adm-danger-soft);
    color: var(--adm-danger);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.adm-result-icon.warn {
    background: #fff7ed;
    color: #ea580c;
    border: 1px solid #fed7aa;
}

/* Loading modal */
.adm-modal-loading {
    max-width: 400px;
    padding: 32px 28px 28px;
    text-align: center;
}

.adm-loading-modal {
    z-index: 350;
    pointer-events: all;
    opacity: 1;
    transition: opacity 0.16s ease;
}

.adm-loading-modal.is-hiding {
    opacity: 0;
    pointer-events: none;
}

body.adm-loading-open {
    overflow: hidden;
}

.adm-loading-rings {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 18px;
}

.adm-loading-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid transparent;
}

.adm-loading-ring-1 {
    border-top-color: var(--adm-brand, #e8353a);
    border-right-color: rgba(232, 53, 58, 0.35);
    animation: adm-loading-spin 1.1s linear infinite;
}

.adm-loading-ring-2 {
    inset: 9px;
    border-bottom-color: var(--adm-brand, #e8353a);
    border-left-color: rgba(232, 53, 58, 0.2);
    animation: adm-loading-spin 1.6s linear infinite reverse;
}

.adm-loading-ring-3 {
    inset: 18px;
    border-top-color: rgba(232, 53, 58, 0.55);
    animation: adm-loading-spin 0.9s linear infinite;
}

.adm-loading-core {
    position: absolute;
    inset: 30px;
    border-radius: 50%;
    background: var(--adm-brand, #e8353a);
    animation: adm-loading-pulse 1.6s ease-out infinite;
}

@keyframes adm-loading-spin {
    to { transform: rotate(360deg); }
}

@keyframes adm-loading-pulse {
    0% { transform: scale(0.92); box-shadow: 0 0 0 0 rgba(232, 53, 58, 0.35); }
    70% { transform: scale(1); box-shadow: 0 0 0 12px rgba(232, 53, 58, 0); }
    100% { transform: scale(0.92); box-shadow: 0 0 0 0 rgba(232, 53, 58, 0); }
}

.adm-loading-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--adm-text);
    margin: 0 0 8px;
    animation: adm-loading-text 1.8s ease-in-out infinite;
}

.adm-loading-desc {
    font-size: 13px;
    color: var(--adm-muted);
    line-height: 1.55;
    margin: 0 0 16px;
}

@keyframes adm-loading-text {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.adm-loading-progress {
    width: 100%;
    height: 4px;
    border-radius: 999px;
    background: var(--adm-border, #e2e8f0);
    overflow: hidden;
    margin-bottom: 16px;
}

.adm-loading-progress-bar {
    width: 42%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, transparent, var(--adm-brand, #e8353a), transparent);
    animation: adm-loading-bar 1.4s ease-in-out infinite;
}

@keyframes adm-loading-bar {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(320%); }
}

.adm-loading-steps {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.adm-loading-step {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--adm-border);
    background: var(--adm-bg-soft, #f8fafc);
    font-size: 11px;
    color: var(--adm-muted);
}

.adm-loading-step-icon {
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid var(--adm-border);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}

.adm-loading-step.is-active {
    border-color: rgba(232, 53, 58, 0.35);
    background: var(--adm-brand-soft, rgba(232, 53, 58, 0.08));
    color: var(--adm-brand, #e8353a);
    animation: adm-loading-step-pulse 1.2s ease-in-out infinite;
}

.adm-loading-step.is-active .adm-loading-step-icon {
    border-color: var(--adm-brand, #e8353a);
    background: var(--adm-brand, #e8353a);
    color: #fff;
}

.adm-loading-step.is-done {
    border-color: rgba(16, 185, 129, 0.25);
    background: rgba(16, 185, 129, 0.06);
    color: var(--adm-green, #10b981);
}

.adm-loading-step.is-done .adm-loading-step-icon {
    border-color: rgba(16, 185, 129, 0.35);
    background: rgba(16, 185, 129, 0.12);
    color: var(--adm-green, #10b981);
}

@keyframes adm-loading-step-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(232, 53, 58, 0.12); }
    50% { box-shadow: 0 0 0 6px rgba(232, 53, 58, 0); }
}

.adm-result-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.adm-result-stat {
    background: var(--adm-surface-2);
    border: 1px solid var(--adm-border);
    border-radius: var(--adm-radius-sm);
    padding: 12px 8px;
}

.adm-result-stat-val {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--adm-text);
    line-height: 1.2;
}

.adm-result-stat-label {
    display: block;
    font-size: 11px;
    color: var(--adm-muted);
    margin-top: 4px;
}

.adm-result-close {
    min-width: 120px;
}

/* AI panel */
.adm-card-ai .adm-form-ai { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.adm-field-hint { display: block; font-size: 11px; color: var(--adm-muted); margin-top: 4px; font-style: normal; }
.adm-btn-ai { background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; border: none; }
.adm-btn-ai:hover { filter: brightness(1.08); }
.adm-ai-panel {
    margin: 0 20px 16px;
    padding: 16px;
    background: linear-gradient(135deg, #f5f3ff 0%, #eff6ff 100%);
    border: 1px solid #c7d2fe;
    border-radius: var(--adm-radius-sm);
}
.adm-ai-panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.adm-ai-panel-head h4 { font-size: 14px; font-weight: 600; color: #4338ca; }
.adm-ai-content { font-size: 13px; line-height: 1.7; color: var(--adm-text); }
.adm-ai-text p { margin-bottom: 8px; }
.adm-ai-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 16px;
    margin-bottom: 14px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: var(--adm-radius-sm);
    font-size: 13px;
    color: #9a3412;
}
.adm-ai-snippet { color: #4338ca; font-size: 12px; line-height: 1.5; cursor: help; }
.adm-ai-banner-demo { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.adm-pipeline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 16px; margin-bottom: 12px; background: var(--adm-surface-2); border-radius: var(--adm-radius-sm); border: 1px solid var(--adm-border); }
.adm-pipeline-step { text-align: center; min-width: 72px; }
.adm-pipeline-val { display: block; font-size: 20px; font-weight: 700; color: var(--adm-text); }
.adm-pipeline-label { display: block; font-size: 11px; color: var(--adm-muted); margin-top: 2px; }
.adm-pipeline-arrow { color: var(--adm-muted); font-size: 16px; }
.adm-pipeline-hint { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--adm-muted); margin-bottom: 14px; padding: 8px 12px; background: #f8fafc; border-radius: 8px; }
.adm-pipeline-hint-step { font-weight: 600; color: var(--adm-text); }
.adm-reject-summary { padding: 10px 14px; margin-bottom: 12px; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 8px; font-size: 12px; line-height: 1.8; }
.adm-reject-summary .adm-tag em { font-style: normal; font-weight: 700; margin-left: 4px; }
.adm-rule-block { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--adm-border); }
.adm-rule-steps { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--adm-muted); margin-bottom: 4px; }
.adm-rule-step { padding: 4px 10px; border-radius: 999px; background: var(--adm-bg, #f1f5f9); }
.adm-rule-step-active { background: rgba(59, 130, 246, 0.12); color: var(--adm-primary, #3b82f6); font-weight: 600; }
.adm-parse-empty { padding: 14px; border: 1px dashed var(--adm-border); border-radius: 8px; color: var(--adm-muted); font-size: 13px; text-align: center; }
.adm-parse-result { padding: 12px 14px; border-radius: 8px; border: 1px solid var(--adm-border); background: #f8fafc; }
.adm-parse-result.adm-parse-ok { border-color: #93c5fd; background: rgba(59, 130, 246, 0.05); }
.adm-parse-result.adm-parse-warn { border-color: #fcd34d; background: #fffbeb; }
.adm-parse-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.adm-parse-summary { margin: 0 0 10px; font-size: 13px; line-height: 1.6; }
.adm-parse-params { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.adm-parse-params li { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 6px 8px; background: #fff; border-radius: 6px; }
.adm-parse-k { color: var(--adm-muted); }
.adm-parse-v { font-weight: 600; color: var(--adm-text); }
.adm-advanced-rules { margin: 12px 0; font-size: 13px; color: var(--adm-muted); }
.adm-advanced-rules summary { cursor: pointer; padding: 8px 0; font-weight: 600; color: var(--adm-text); }
.adm-form-compact { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; padding-top: 10px; }
.adm-rule-field em { font-style: normal; font-size: 11px; }
.adm-rule-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.adm-tip-ai { color: var(--adm-primary, #3b82f6); background: rgba(59, 130, 246, 0.08); padding: 8px 10px; border-radius: 6px; }
.adm-tip-warn { color: #b45309; background: rgba(245, 158, 11, 0.1); padding: 8px 10px; border-radius: 6px; }
.adm-tag-warn { background: rgba(245, 158, 11, 0.15); color: #b45309; }
.adm-preview-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.adm-switch-sm { font-size: 12px; }
.adm-score { display: inline-block; min-width: 28px; padding: 2px 6px; border-radius: 6px; font-size: 11px; font-weight: 700; text-align: center; }
.adm-score-high { background: #dcfce7; color: #166534; }
.adm-score-mid { background: #fef9c3; color: #854d0e; }
.adm-score-low { background: #fee2e2; color: #991b1b; }
.adm-log-stats { display: flex; flex-wrap: wrap; gap: 16px; padding: 12px 16px; font-size: 13px; color: var(--adm-muted); }
.adm-log-stats strong { color: var(--adm-text); }
.adm-ai-progress { margin-bottom: 12px; padding: 10px 14px; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px; }
.adm-ai-progress-track { height: 6px; background: #dbeafe; border-radius: 3px; overflow: hidden; margin-bottom: 6px; }
.adm-ai-progress-bar { height: 100%; background: linear-gradient(90deg, #3b82f6, #2563eb); transition: width 0.25s ease; }
.adm-ai-progress-text { font-size: 12px; color: #1e40af; font-weight: 600; }
.adm-history-list { display: flex; flex-direction: column; gap: 6px; padding: 10px 16px 14px; }
.adm-history-item { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; color: var(--adm-muted); padding: 6px 0; border-bottom: 1px solid var(--adm-border); }
.adm-history-item:last-child { border-bottom: none; }
.adm-history-time { font-family: ui-monospace, monospace; font-size: 11px; }
.adm-module-prompt { padding: 12px 0; border-bottom: 1px solid var(--adm-border); }
.adm-module-prompt:last-child { border-bottom: none; }
.adm-card-highlight { border-color: #93c5fd; box-shadow: 0 0 0 1px rgba(59,130,246,.08); }
.adm-card-pull .adm-pull-guide ol { margin: 8px 0 12px 20px; line-height: 1.8; font-size: 13px; }
.adm-guide-table .adm-guide-item { margin-bottom: 10px; }
.adm-integration-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 12px; }
.adm-integration-item { padding: 8px 10px; border-radius: 8px; font-size: 12px; border: 1px solid var(--adm-border); background: var(--adm-surface-2); }
.adm-integration-item.on { border-color: #86efac; background: #f0fdf4; color: #166534; }
.adm-integration-item.off { color: var(--adm-muted); }
.adm-card-compact { margin-bottom: 14px; }
.adm-tag-green { background: var(--adm-green-soft); color: var(--adm-green); border-color: rgba(16,185,129,.25); }

/* Login */
.adm-login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(160deg, #f8fafc 0%, #eef2f7 50%, #f5f0f0 100%);
    position: relative;
    overflow: hidden;
}

.adm-login-page::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(232, 53, 58, 0.06) 0%, transparent 70%);
    top: -200px;
    right: -150px;
    pointer-events: none;
}

.adm-login-wrap {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.adm-login-card {
    background: #fff;
    border: 1px solid var(--adm-border);
    border-radius: var(--adm-radius-lg);
    padding: 36px 32px;
    box-shadow: var(--adm-shadow-lg);
}

.adm-login-brand { text-align: center; margin-bottom: 32px; }

.adm-login-logo {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(145deg, var(--adm-brand-light), var(--adm-brand));
    display: grid;
    place-items: center;
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin: 0 auto 14px;
    box-shadow: 0 8px 24px var(--adm-brand-glow);
}

.adm-login-brand h1 { font-size: 20px; font-weight: 700; color: var(--adm-text); }
.adm-login-brand p { font-size: 13px; color: var(--adm-muted); margin-top: 6px; }

.adm-login-form label {
    display: block;
    margin-bottom: 16px;
    font-size: 12px;
    font-weight: 500;
    color: var(--adm-text-secondary);
}

.adm-login-form input {
    width: 100%;
    margin-top: 7px;
    padding: 11px 14px;
    background: #fff;
    border: 1px solid var(--adm-border);
    border-radius: var(--adm-radius-sm);
    color: var(--adm-text);
    font-size: 14px;
    font-family: inherit;
    transition: border-color var(--adm-transition), box-shadow var(--adm-transition);
}

.adm-login-form input:focus {
    outline: none;
    border-color: var(--adm-brand);
    box-shadow: 0 0 0 3px var(--adm-brand-soft);
}

.adm-login-hint { font-size: 11px; color: var(--adm-muted); text-align: center; margin-top: 14px; }
.adm-login-err { color: var(--adm-danger); font-size: 12px; text-align: center; margin-top: 10px; font-weight: 500; }

.adm-login-back {
    display: block;
    text-align: center;
    margin-top: 22px;
    font-size: 13px;
    color: var(--adm-muted);
    transition: color var(--adm-transition);
}

.adm-login-back:hover { color: var(--adm-brand); }

/* Screening engine */
.adm-screen-card { border-color: rgba(232, 53, 58, 0.15); }
.adm-screen-actions { display: flex; gap: 8px; }
.adm-screen-stats { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.adm-stat-mini { min-width: 100px; padding: 12px 14px; }
.adm-stat-mini .adm-stat-val { font-size: 22px; }
.adm-screen-rule { font-size: 13px; color: var(--adm-text-secondary); margin-bottom: 14px; padding: 10px 12px; background: var(--adm-surface-2); border-radius: var(--adm-radius-sm); }
.adm-screen-last { font-size: 13px; color: var(--adm-text); margin-bottom: 6px; }
.adm-screen-rejected { margin-top: 14px; font-size: 13px; color: var(--adm-muted); }
.adm-screen-rejected summary { cursor: pointer; padding: 8px 0; }

.adm-rise-track { display: flex; flex-wrap: wrap; gap: 4px; }
.adm-rise-day {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 6px;
    border-radius: 4px;
    white-space: nowrap;
}
.adm-rise-day.up { background: var(--adm-green-soft); color: var(--adm-green); }
.adm-rise-day.down { background: var(--adm-danger-soft); color: var(--adm-danger); }
.adm-rise-day.flat { background: var(--adm-surface-2); color: var(--adm-muted); }

.adm-up { color: var(--adm-green); font-weight: 600; }
.adm-down { color: var(--adm-danger); }
.adm-muted { color: var(--adm-muted); font-size: 11px; }

.adm-analysis-body { padding: 18px 20px; max-height: 70vh; overflow-y: auto; }
.adm-analysis-head { margin-bottom: 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.adm-analysis-reason { font-size: 14px; color: var(--adm-text); margin-bottom: 12px; line-height: 1.6; }
.adm-analysis-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--adm-text-secondary); margin-bottom: 14px; }
.adm-analysis-timeline { margin-bottom: 14px; }
.adm-table-compact th, .adm-table-compact td { padding: 8px 10px; }

/* Engine hub */
.adm-engine-loading { display: flex; align-items: center; justify-content: center; min-height: 280px; }
.adm-engine-loading-spin { width: 32px; height: 32px; border: 3px solid #e2e8f0; border-top-color: #3b82f6; border-radius: 50%; animation: adm-spin 0.8s linear infinite; }
@keyframes adm-spin { to { transform: rotate(360deg); } }
.adm-engine-layout { display: grid; grid-template-columns: 200px 1fr; gap: 18px; min-height: 70vh; }
.adm-engine-nav { display: flex; flex-direction: column; gap: 6px; }
.adm-engine-nav-item {
    text-align: left;
    border: 1px solid var(--adm-border);
    background: #fff;
    border-radius: var(--adm-radius-sm);
    padding: 12px 14px;
    cursor: pointer;
    transition: all var(--adm-transition);
    font-family: inherit;
}
.adm-engine-nav-item:hover { border-color: var(--adm-border-strong); box-shadow: var(--adm-shadow); }
.adm-engine-nav-item.active {
    border-color: rgba(232, 53, 58, 0.35);
    background: var(--adm-brand-soft);
    box-shadow: inset 3px 0 0 var(--adm-brand);
}
.adm-engine-nav-title { display: block; font-size: 13px; font-weight: 600; color: var(--adm-text); }
.adm-engine-nav-meta { display: block; font-size: 11px; color: var(--adm-muted); margin-top: 4px; }
.adm-engine-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.adm-engine-head h2 { font-size: 18px; font-weight: 700; }
.adm-engine-sub { font-size: 12px; color: var(--adm-muted); margin-top: 4px; }
.adm-engine-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.adm-engine-action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 16px 18px;
    margin-bottom: 16px;
    border-radius: 12px;
    border: 1px solid var(--adm-border);
    background: var(--adm-surface-2);
    box-shadow: var(--adm-shadow);
}
.adm-engine-action-bar-text strong {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: var(--adm-text);
    margin-bottom: 4px;
}
.adm-engine-action-bar-text span {
    font-size: 12px;
    color: var(--adm-muted);
    line-height: 1.5;
}
.adm-engine-action-btns {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}
.adm-btn-engine {
    min-width: 148px;
    padding: 12px 22px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    border-radius: 10px !important;
    position: relative;
}
.adm-btn-engine-preview {
    background: #fff !important;
    border: 2px solid var(--adm-border-strong, #cbd5e1) !important;
    color: var(--adm-text) !important;
}
.adm-btn-engine-preview:hover:not(:disabled) {
    border-color: var(--adm-primary, #3b82f6) !important;
    color: var(--adm-primary, #3b82f6) !important;
}
.adm-btn-engine-apply:not(:disabled) {
    box-shadow: 0 4px 14px rgba(232, 53, 58, 0.25);
}
.adm-btn-engine.is-loading {
    opacity: 0.85;
    pointer-events: none;
}
.adm-btn-engine-hint {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: var(--adm-primary, #3b82f6);
    margin-top: 2px;
}
.adm-btn-engine-label { display: block; }

/* Button cycle: loading → success/error → reset (闭环) */
.adm-btn-cycle {
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.25s ease, transform 0.2s ease, border-color 0.25s ease;
}
.adm-btn-cycle.is-cycle-loading { pointer-events: none; }
.adm-btn-cycle--keep-html.is-cycle-loading > * { opacity: 0.15; }
.adm-btn-cycle--keep-html.is-cycle-loading::after {
    content: attr(data-cycle-msg);
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: inherit;
    font-weight: 600;
    color: inherit;
    z-index: 2;
}
.adm-btn-cycle.is-cycle-loading::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0.85;
}
.adm-btn-cycle.is-cycle-success {
    animation: adm-cycle-success-pop 0.45s ease;
}
.adm-btn-cycle.is-cycle-error {
    animation: adm-cycle-error-shake 0.45s ease;
}
.adm-btn-cycle.is-cycle-reset {
    transition: opacity 0.35s ease, transform 0.35s ease;
    opacity: 0.92;
    transform: scale(0.98);
}

@keyframes adm-cycle-success-pop {
    0% { transform: scale(1); }
    40% { transform: scale(1.04); box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25); }
    100% { transform: scale(1); }
}
@keyframes adm-cycle-error-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}

/* FX: default spin ring */
.adm-btn-cycle--default.is-cycle-loading::before {
    background: radial-gradient(circle at 50% 50%, transparent 58%, rgba(59, 130, 246, 0.12) 59%);
    animation: adm-fx-spin 0.8s linear infinite;
}
.adm-btn-cycle--sk-save.is-cycle-loading::before {
    background: linear-gradient(120deg, transparent 30%, rgba(16, 185, 129, 0.22) 50%, transparent 70%);
    background-size: 220% 100%;
    animation: adm-fx-shimmer 1.1s ease infinite;
}
.adm-btn-cycle--sk-test.is-cycle-loading::before {
    background: repeating-conic-gradient(from 0deg, rgba(59, 130, 246, 0.15) 0 12deg, transparent 12deg 24deg);
    animation: adm-fx-spin 1.2s linear infinite;
}
.adm-btn-cycle--sk-sync.is-cycle-loading::before {
    background: linear-gradient(90deg, rgba(124, 58, 237, 0.08) 0%, rgba(124, 58, 237, 0.28) 50%, rgba(124, 58, 237, 0.08) 100%);
    background-size: 200% 100%;
    animation: adm-fx-slide 1s ease infinite;
}
.adm-btn-cycle--sk-pull.is-cycle-loading::before {
    background: linear-gradient(180deg, rgba(234, 88, 12, 0.05) 0%, rgba(234, 88, 12, 0.35) 100%);
    transform-origin: bottom;
    animation: adm-fx-fill-up 1.4s ease-in-out infinite;
}
.adm-btn-cycle--sk-preview.is-cycle-loading::before {
    background: linear-gradient(180deg, transparent 0%, rgba(14, 165, 233, 0.35) 48%, transparent 52%);
    background-size: 100% 220%;
    animation: adm-fx-scan 1.1s ease-in-out infinite;
}
.adm-btn-cycle--sk-refresh.is-cycle-loading::before {
    border: 2px solid rgba(100, 116, 139, 0.2);
    border-top-color: rgba(100, 116, 139, 0.75);
    border-radius: 50%;
    inset: 6px;
    animation: adm-fx-spin 0.75s linear infinite;
}
.adm-btn-cycle--sk-stock.is-cycle-loading::before {
    background: radial-gradient(circle, rgba(139, 92, 246, 0.25) 0%, transparent 65%);
    animation: adm-fx-pulse 1s ease infinite;
}
.adm-btn-cycle--sk-search.is-cycle-loading::before {
    background: radial-gradient(circle at 20% 50%, rgba(59, 130, 246, 0.35) 0 8%, transparent 8%),
        radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.35) 0 8%, transparent 8%),
        radial-gradient(circle at 80% 50%, rgba(59, 130, 246, 0.35) 0 8%, transparent 8%);
    animation: adm-fx-dots 1s steps(3) infinite;
}
.adm-btn-cycle--sk-flow.is-cycle-loading::before {
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.45), rgba(255,255,255,0.1));
    background-size: 300% 300%;
    animation: adm-fx-shimmer 1.3s ease infinite;
}
.adm-btn-cycle--sk-page.is-cycle-loading::before {
    background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.35), transparent);
    animation: adm-fx-slide 0.9s ease infinite;
}

.adm-btn-cycle--tj-preview.is-cycle-loading::before {
    background: radial-gradient(circle, rgba(196, 30, 36, 0.2) 0%, transparent 70%);
    animation: adm-fx-pulse 0.9s ease infinite;
}
.adm-btn-cycle--tj-apply.is-cycle-loading::before {
    background: linear-gradient(90deg, rgba(196, 30, 36, 0.15) 0%, rgba(196, 30, 36, 0.45) var(--adm-cycle-fill, 30%), rgba(196, 30, 36, 0.15) 100%);
    animation: adm-fx-fill-bar 1.6s ease-in-out infinite;
}
.adm-btn-cycle--tj-q-preview.is-cycle-loading::before {
    background: repeating-linear-gradient(-45deg, rgba(124, 58, 237, 0.08) 0 8px, rgba(124, 58, 237, 0.22) 8px 16px);
    animation: adm-fx-slide 0.8s linear infinite;
}
.adm-btn-cycle--tj-q-apply.is-cycle-loading::before {
    background: conic-gradient(from 0deg, rgba(196, 30, 36, 0.35), transparent 40%, rgba(196, 30, 36, 0.15));
    animation: adm-fx-spin 1s linear infinite;
}
.adm-btn-cycle--tj-q-all.is-cycle-loading::before {
    background: linear-gradient(120deg, rgba(234, 88, 12, 0.12), rgba(196, 30, 36, 0.28), rgba(124, 58, 237, 0.12));
    background-size: 300% 300%;
    animation: adm-fx-shimmer 1.2s ease infinite;
}
.adm-btn-cycle--tj-f-preview.is-cycle-loading::before {
    background: linear-gradient(180deg, transparent, rgba(37, 99, 235, 0.35), transparent);
    background-size: 100% 200%;
    animation: adm-fx-scan 1s ease infinite;
}
.adm-btn-cycle--tj-f-apply.is-cycle-loading::before {
    background: radial-gradient(ellipse at bottom, rgba(37, 99, 235, 0.35), transparent 70%);
    animation: adm-fx-pulse 0.85s ease infinite;
}
.adm-btn-cycle--tj-save.is-cycle-loading::before {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.35), rgba(16, 185, 129, 0.1));
    animation: adm-fx-slide 1s ease infinite;
}
.adm-btn-cycle--tj-ai-parse.is-cycle-loading::before {
    background: radial-gradient(circle at 30% 40%, rgba(250, 204, 21, 0.35), transparent 45%),
        radial-gradient(circle at 70% 60%, rgba(196, 30, 36, 0.25), transparent 40%);
    animation: adm-fx-pulse 0.7s ease infinite alternate;
}
.adm-btn-cycle--tj-ai-run.is-cycle-loading::before {
    background: conic-gradient(from 180deg, rgba(124, 58, 246, 0.3), rgba(196, 30, 36, 0.2), rgba(124, 58, 246, 0.3));
    animation: adm-fx-spin 1.1s linear infinite;
}

@keyframes adm-fx-spin { to { transform: rotate(360deg); } }
@keyframes adm-fx-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes adm-fx-slide { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes adm-fx-scan { 0% { background-position: 0 -120%; } 100% { background-position: 0 220%; } }
@keyframes adm-fx-fill-up { 0%, 100% { transform: scaleY(0.15); } 50% { transform: scaleY(1); } }
@keyframes adm-fx-pulse { 0%, 100% { opacity: 0.45; transform: scale(0.96); } 50% { opacity: 1; transform: scale(1); } }
@keyframes adm-fx-dots { 0% { opacity: 0.35; } 33% { opacity: 1; } 66% { opacity: 0.55; } 100% { opacity: 0.35; } }
@keyframes adm-fx-fill-bar { 0% { --adm-cycle-fill: 10%; } 50% { --adm-cycle-fill: 85%; } 100% { --adm-cycle-fill: 10%; } }

.adm-engine-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.adm-quant-engine-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.adm-quant-tab {
    border: 1px solid var(--adm-border);
    background: #fff;
    padding: 8px 14px;
    border-radius: 100px;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
}
.adm-quant-tab.active { background: var(--adm-brand-soft); border-color: rgba(232,53,58,.3); color: var(--adm-brand); font-weight: 600; }

.adm-fut-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; padding: 0 4px; }
.adm-fut-tab {
    border: 1px solid var(--adm-border);
    background: #fff;
    padding: 8px 14px;
    border-radius: 100px;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
}
.adm-fut-tab.active { background: var(--adm-brand-soft); border-color: rgba(232,53,58,.3); color: var(--adm-brand); font-weight: 600; }
.adm-fut-tab-count { opacity: .75; font-size: 11px; margin-left: 2px; }
.adm-fut-cat-desc { margin: 0 0 12px; padding: 0 4px; }
.adm-fut-preview-group { margin-bottom: 8px; }
.adm-fut-preview-group:last-child { margin-bottom: 0; }
.adm-fut-preview-label {
    display: block;
    font-size: 11px;
    color: var(--adm-text-3, #64748b);
    margin-bottom: 4px;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 960px) {
    .adm-grid-2 { grid-template-columns: 1fr; }
    .adm-sidebar { transform: translateX(-100%); }
    .adm-main { margin-left: 0; }
}

.adm-news-sources {
    display: grid;
    gap: 12px;
}

.adm-news-source-item {
    display: grid;
    grid-template-columns: minmax(180px, 220px) 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid var(--adm-border, #e2e8f0);
    border-radius: 10px;
    background: #f8fafc;
}

.adm-field-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.adm-field-inline input {
    width: 72px;
}

@media (max-width: 960px) {
    .adm-news-source-item {
        grid-template-columns: 1fr;
    }
}
