/* Buttons, tabs, inputs, selects, dialogs, and UI components */

/* ================================================
           THEME TOGGLE BUTTON
           ================================================ */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-tertiary);
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    z-index: 10;
    backdrop-filter: blur(8px);
}

.theme-toggle:hover {
    color: var(--text-secondary);
    border-color: var(--border-default);
    background: var(--bg-hover);
}

/* ================================================
           HERO BANNER — Refined with depth
           ================================================ */
.hero-controls {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10;
}
.hero-banner {
    text-align: center;
    padding: 48px 0 40px;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
}

.hero-banner::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(
            ellipse at 50% 0%,
            rgba(108, 122, 224, 0.1) 0%,
            transparent 60%
        ),
        radial-gradient(
            ellipse at 30% 100%,
            rgba(212, 168, 83, 0.05) 0%,
            transparent 50%
        );
    pointer-events: none;
}

.hero-banner::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--border-default),
        transparent
    );
}

/* Welcome page — subtle radial glow behind logo */
.welcome-glow {
    position: relative;
}

.welcome-glow::before {
    content: "";
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
    height: 300px;
    background: radial-gradient(
        ellipse at 50% 30%,
        rgba(85, 96, 200, 0.07) 0%,
        transparent 70%
    );
    pointer-events: none;
}

.hero-banner .hero-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 14px;
    position: relative;
}

.hero-banner .hero-title svg {
    opacity: 0.85;
    filter: drop-shadow(0 0 12px rgba(108, 122, 224, 0.3));
}

.hero-banner h1 {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.hero-banner h1 .brand-name {
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-banner h1 .brand-divider {
    display: inline-block;
    width: 2px;
    height: 22px;
    background: var(--text-tertiary);
    border-radius: 1px;
    flex-shrink: 0;
}

.hero-banner h1 .brand-tagline {
    font-family: var(--font-display);
    font-weight: 400;
    letter-spacing: 3px;
    color: var(--text-tertiary);
}

.hero-banner h1 .accent {
    font-family: var(--font-display);
    font-weight: 400;
    background: linear-gradient(135deg, var(--accent), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-style: italic;
}

.hero-banner .hero-subtitle {
    font-size: 14px;
    color: var(--text-tertiary);
    font-weight: 400;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.hero-banner .hero-features {
    display: grid;
    grid-template-columns: repeat(4, 116px); /* 4 columns on desktop */
    justify-content: center;
    gap: 10px 14px;
    max-width: 520px;
    margin: 24px auto 0;
    padding: 0 20px;
    animation: fadeInUp 0.4s ease both;
    animation-delay: 0.05s;
}

.hero-banner .feature-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center; /* Center text and dot inside tag */
    gap: 8px;
    padding: 6px 0; /* Remove horizontal padding since width is fixed by grid */
    width: 100%;
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    cursor: default;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.hero-banner .feature-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    transition: all var(--transition-fast);
}

/* Individual Color Themes for Tags */
.hero-banner .tag-accent .feature-dot {
    background-color: var(--accent);
}
.hero-banner .tag-gold .feature-dot {
    background-color: var(--gold);
}
.hero-banner .tag-green .feature-dot {
    background-color: var(--green);
}
.hero-banner .tag-yellow .feature-dot {
    background-color: var(--yellow);
}
.hero-banner .tag-red .feature-dot {
    background-color: var(--red);
}

/* Hover effect */
.hero-banner .feature-tag:hover {
    transform: translateY(-2px);
    background: var(--bg-elevated);
    color: var(--text-primary);
    box-shadow: var(--shadow-md);
}

.hero-banner .tag-accent:hover {
    border-color: rgba(108, 122, 224, 0.4);
    box-shadow: 0 4px 12px rgba(108, 122, 224, 0.15);
}
.hero-banner .tag-gold:hover {
    border-color: rgba(212, 168, 83, 0.4);
    box-shadow: 0 4px 12px rgba(212, 168, 83, 0.15);
}
.hero-banner .tag-green:hover {
    border-color: rgba(52, 184, 90, 0.4);
    box-shadow: 0 4px 12px rgba(52, 184, 90, 0.15);
}
.hero-banner .tag-yellow:hover {
    border-color: rgba(240, 160, 48, 0.4);
    box-shadow: 0 4px 12px rgba(240, 160, 48, 0.15);
}
.hero-banner .tag-red:hover {
    border-color: rgba(240, 96, 96, 0.4);
    box-shadow: 0 4px 12px rgba(240, 96, 96, 0.15);
}

@media (max-width: 768px) {
    .hero-banner .hero-features {
        grid-template-columns: repeat(2, 116px); /* 2 columns on mobile */
        gap: 8px 12px;
        margin-top: 16px;
        padding: 0 10px;
        max-width: 270px;
    }
    .hero-banner .feature-tag {
        padding: 5px 0;
        font-size: 11px;
        gap: 6px;
    }
    .hero-banner .feature-dot {
        width: 5px;
        height: 5px;
    }
}

/* ================================================
           PANELS — Glass-morphism depth
           ================================================ */
.panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 20px;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.panel:hover {
    border-color: var(--border-default);
    box-shadow: var(--shadow-md);
}

.panel-header {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-header .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent-muted);
}

/* ================================================
           FORM SECTION
           ================================================ */
.form-section {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.form-section:hover {
    box-shadow: var(--shadow-md);
}

.form-section-header {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-section-header svg {
    color: var(--accent);
    opacity: 0.8;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px 32px;
    margin-bottom: 24px;
}

.form-row:last-child {
    margin-bottom: 0;
}

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

.form-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-label .required {
    color: var(--accent);
}

.score-display {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(
        135deg,
        var(--green-muted),
        rgba(108, 122, 224, 0.06)
    );
    border: 1px solid rgba(52, 184, 90, 0.2);
    border-radius: var(--radius-md);
    padding: 12px 20px;
    font-size: 14px;
}

.score-display .label {
    color: var(--green);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.5px;
}

.score-display .value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.score-display .unit {
    color: var(--text-tertiary);
    font-size: 13px;
}

.score-display .separator {
    color: var(--text-tertiary);
    margin: 0 4px;
    opacity: 0.5;
}

.score-range {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-tertiary);
}

/* ================================================
           ACCENT MARKDOWN — wanted/unwanted panels
           ================================================ */
.accent-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    margin-bottom: 16px;
    transition: all var(--transition-base);
}

.accent-panel.wanted {
    border-color: rgba(52, 184, 90, 0.25);
    background: linear-gradient(135deg, var(--bg-surface), var(--green-muted));
}

.accent-panel.wanted .section-title {
    color: var(--green);
}

.accent-panel.unwanted {
    border-color: rgba(240, 96, 96, 0.25);
    background: linear-gradient(135deg, var(--bg-surface), var(--red-muted));
}

.accent-panel.unwanted .section-title {
    color: var(--red);
}

.accent-panel .section-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.accent-panel .section-desc {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 14px;
}

.cat-tag {
    font-weight: 600;
    border-radius: 4px !important;
}
.cat-tag .tag-prefix {
    font-size: 9px;
    opacity: 0.7;
    margin-right: 3px;
    font-weight: 400;
}
.major-tag {
    border-radius: 10px !important;
}
.major-tag .tag-prefix {
    font-size: 9px;
    opacity: 0.5;
    margin-right: 2px;
}

/* ================================================
           CUSTOM CONFIRM DIALOG
           ================================================ */
.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.confirm-modal {
    background: var(--bg-elevated, #1e1e2e);
    border: 1px solid var(--border-default, #333);
    border-radius: var(--radius-xl, 16px);
    padding: 28px 32px 24px;
    width: 400px;
    max-width: 90vw;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: confirm-pop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes confirm-pop {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}
.confirm-modal-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    background: linear-gradient(
        135deg,
        rgba(255, 183, 77, 0.15),
        rgba(255, 183, 77, 0.05)
    );
    color: #ffb74d;
    border: 1px solid rgba(255, 183, 77, 0.2);
}
.confirm-modal-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, #e0e0e0);
    text-align: center;
    margin: 0 0 10px;
}
.confirm-modal-message {
    font-size: 13px;
    color: var(--text-secondary, #aaa);
    text-align: center;
    line-height: 1.6;
    margin: 0 0 24px;
}
.confirm-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}
.confirm-modal-actions .btn {
    min-width: 80px;
}
.confirm-fade-enter-active {
    transition: opacity 0.2s ease;
}
.confirm-fade-leave-active {
    transition: opacity 0.15s ease;
}
.confirm-fade-enter-from,
.confirm-fade-leave-to {
    opacity: 0;
}

.preview-switching {
    opacity: 0;
    transform: translateY(4px);
}

/* ================================================
           BUTTONS — Refined with gradient & glow
           ================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 18px;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    text-decoration: none;
    outline: none;
    position: relative;
    overflow: hidden;
}

.btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #7b61e0);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(108, 122, 224, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-hover), #8b71e8);
    box-shadow: 0 4px 16px rgba(108, 122, 224, 0.4);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(108, 122, 224, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-default);
    backdrop-filter: blur(4px);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--text-tertiary);
}

.btn-text {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
    padding: 6px 10px;
}

.btn-text:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.btn-success {
    background: linear-gradient(135deg, var(--green), #2eaa50);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(52, 184, 90, 0.3);
}

.btn-success:hover {
    box-shadow: 0 4px 16px rgba(52, 184, 90, 0.4);
    transform: translateY(-1px);
}

.btn-lg {
    padding: 14px 32px;
    font-size: 15px;
    border-radius: var(--radius-lg);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

/* ================================================
           FILTER CHIPS — Toggle filter buttons
           ================================================ */
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 14px;
    font-family: var(--font-sans);
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-default);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    outline: none;
    background: transparent;
    color: var(--text-secondary);
    user-select: none;
}

.filter-chip:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--text-tertiary);
}

.filter-chip:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.filter-chip svg {
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

/* Warning chip — red theme */
.filter-chip-warning.active {
    background: var(--red-muted);
    border-color: var(--red);
    color: var(--red);
    box-shadow: 0 0 12px rgba(240, 96, 96, 0.12);
}

.filter-chip-warning.active:hover {
    background: rgba(240, 96, 96, 0.16);
    border-color: var(--red);
}

/* Wanted chip — green theme */
.filter-chip-wanted.active {
    background: var(--green-muted);
    border-color: var(--green);
    color: var(--green);
    box-shadow: 0 0 12px rgba(52, 184, 90, 0.12);
}

.filter-chip-wanted.active:hover {
    background: rgba(52, 184, 90, 0.16);
    border-color: var(--green);
}

/* Light theme filter chip overrides */
body.theme-light .filter-chip-warning.active {
    background: rgba(208, 64, 64, 0.12);
    box-shadow: 0 0 12px rgba(208, 64, 64, 0.08);
}

body.theme-light .filter-chip-warning.active:hover {
    background: rgba(208, 64, 64, 0.18);
}

body.theme-light .filter-chip-wanted.active {
    background: rgba(34, 128, 74, 0.12);
    box-shadow: 0 0 12px rgba(34, 128, 74, 0.08);
}

body.theme-light .filter-chip-wanted.active:hover {
    background: rgba(34, 128, 74, 0.18);
}

/* ================================================
           TABS — Refined pill navigation
           ================================================ */
.el-tabs {
    --el-tabs-header-height: 44px;
}

/* Nav bar — standalone pill bar */
.el-tabs__header {
    margin-bottom: 0 !important;
    background: var(--bg-surface) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: var(--radius-lg) !important;
    padding: 4px !important;
    box-shadow: var(--shadow-sm);
}

.el-tabs__nav {
    display: flex !important;
    gap: 2px !important;
}

.el-tabs__nav-wrap::after {
    display: none !important;
}

.el-tabs__item {
    font-family: var(--font-sans) !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: var(--text-tertiary) !important;
    padding: 0 18px !important;
    height: var(--el-tabs-header-height) !important;
    line-height: var(--el-tabs-header-height) !important;
    transition: all var(--transition-fast) !important;
    border-radius: var(--radius-md) !important;
}

.el-tabs__item:hover {
    color: var(--text-secondary) !important;
    background: var(--bg-hover) !important;
}

.el-tabs__item.is-active {
    color: var(--accent) !important;
    background: var(--accent-muted) !important;
    font-weight: 600 !important;
}

/* Hide default active bar — pill highlight replaces it */
.el-tabs__active-bar {
    display: none !important;
}

/* Content area — separated from nav */
.el-tabs__content {
    overflow: visible !important;
    margin-top: 16px !important;
}

.el-tabs--border-card {
    background: var(--bg-surface) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: var(--radius-lg) !important;
    border-top-left-radius: 0 !important;
    box-shadow: var(--shadow-md) !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.el-tab-pane {
    padding: 0 !important;
    flex-shrink: 0;
}

/* ================================================
           FORM CONTROLS — Linear overrides for Element Plus
           ================================================ */
.el-input__wrapper,
.el-textarea__inner {
    background-color: var(--bg-elevated) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: none !important;
    transition:
        border-color var(--transition-fast),
        box-shadow var(--transition-fast) !important;
    font-family: var(--font-sans) !important;
}

.el-input__wrapper:hover,
.el-textarea__inner:hover {
    border-color: var(--border-default) !important;
}

.el-input__wrapper.is-focus,
.el-textarea__inner:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px var(--accent-muted) !important;
}

.el-input__inner {
    font-family: var(--font-sans) !important;
    color: var(--text-primary) !important;
    font-size: 14px !important;
}

.el-input__inner::placeholder {
    color: var(--text-tertiary) !important;
}

.el-input-number {
    --el-input-bg-color: var(--bg-elevated);
    --el-input-border-color: var(--border-subtle);
    --el-input-hover-border-color: var(--border-default);
    --el-input-focus-border-color: var(--accent);
}

.el-input-number__decrease,
.el-input-number__increase {
    background: var(--bg-hover) !important;
    border-color: var(--border-subtle) !important;
    color: var(--text-tertiary) !important;
}

.el-input-number__decrease:hover,
.el-input-number__increase:hover {
    color: var(--text-primary) !important;
}

.el-input-number .el-input__wrapper {
    background-color: var(--bg-elevated) !important;
}

/* Large input variant */
.el-input--large .el-input__inner {
    font-size: 16px !important;
    font-weight: 500 !important;
}

/* ================================================
           SELECT — Linear style
           ================================================ */
.el-select__wrapper {
    background-color: var(--bg-elevated) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: none !important;
    min-height: 36px !important;
    transition: border-color var(--transition-fast) !important;
}

.el-select__wrapper:hover {
    border-color: var(--border-default) !important;
}

.el-select__wrapper.is-focused {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px var(--accent-muted) !important;
}

/* Preview toolbar */
.preview-toolbar {
    display: flex;
    gap: 16px;
    padding: 12px 16px;
    align-items: center;
    justify-content: space-between;
}
.preview-toolbar .btn-sm {
    padding: 6px 14px;
    font-size: 12.5px;
}
.preview-toolbar-filters {
    display: flex;
    gap: 40px;
    align-items: center;
    flex-shrink: 0;
}
.preview-toolbar-right {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
}
.preview-toolbar-row {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
}

/* Preview filter selects — capsule style (match sandbox container) */
.preview-filter-select .el-select__wrapper {
    background: var(--bg-elevated) !important;
    border: 1px solid var(--border-default) !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    min-height: 0 !important;
    padding: 7px 22px !important;
    font-size: 15px !important;
    height: 42px !important;
}
.preview-filter-select .el-select__wrapper:hover {
    border-color: var(--border-default) !important;
}
.preview-filter-select .el-select__wrapper.is-focused {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px var(--accent-muted) !important;
}
.preview-filter-select .el-select__placeholder {
    font-size: 15px !important;
}
.preview-filter-select .el-select__selected-item .el-tag {
    font-size: 12px !important;
}

.el-select__placeholder,
.el-cascader__placeholder {
    color: var(--text-tertiary) !important;
    font-size: 14px !important;
}

.el-select__selected-item {
    font-size: 14px !important;
}

.el-select__popper,
.el-popper.is-light {
    border-radius: var(--radius-md) !important;
}

.el-select-dropdown {
    background: var(--bg-surface) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important;
    padding: 4px !important;
}

.el-dropdown__popper.is-light,
.el-dropdown__popper {
    background: var(--bg-surface) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important;
    padding: 0 !important;
}

.el-dropdown-menu {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 4px !important;
}

.el-dropdown__popper .el-popper__arrow::before {
    background: var(--bg-surface) !important;
    border: 1px solid var(--border-subtle) !important;
}

.el-select-dropdown__item,
.el-dropdown-menu__item {
    font-size: 14px !important;
    color: var(--text-secondary) !important;
    border-radius: var(--radius-sm) !important;
    padding: 8px 12px !important;
    transition: background var(--transition-fast) !important;
}

.el-select-dropdown__item:hover,
.el-dropdown-menu__item:hover,
.el-dropdown-menu__item:focus {
    background: var(--bg-hover) !important;
    color: var(--text-primary) !important;
}

.el-select-dropdown__item.is-selected {
    color: var(--accent) !important;
    font-weight: 500 !important;
}

.el-select-dropdown__item.is-hovering {
    background: var(--bg-hover) !important;
}

.el-tag {
    background: var(--bg-hover) !important;
    border-color: var(--border-default) !important;
    color: var(--text-secondary) !important;
    font-size: 12px !important;
    border-radius: var(--radius-sm) !important;
}

.el-tag .el-tag__close {
    color: var(--text-tertiary) !important;
}

.el-tag .el-tag__close:hover {
    background: var(--border-default) !important;
    color: var(--text-primary) !important;
}

/* ================================================
           CASCADER
           ================================================ */
.el-cascader__wrapper {
    background-color: var(--bg-elevated) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: none !important;
}

.el-cascader__wrapper:hover {
    border-color: var(--border-default) !important;
}

.el-cascader__wrapper.is-focus {
    border-color: var(--accent) !important;
}

.el-cascader__dropdown {
    background: var(--bg-surface) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important;
    overflow: hidden;
}

.el-cascader-menu {
    background: var(--bg-surface) !important;
    border-color: var(--border-subtle) !important;
    color: var(--text-secondary) !important;
}

.el-cascader-node {
    font-size: 14px !important;
    color: var(--text-secondary) !important;
    border-radius: var(--radius-sm) !important;
    cursor: pointer;
}

/* 点击整行即可勾选，不必精确点击复选框 */
.el-cascader-node__label {
    pointer-events: none;
}

.el-cascader-node:hover {
    background: var(--bg-hover) !important;
    color: var(--text-primary) !important;
}

.el-cascader-node.in-active-path,
.el-cascader-node.is-selectable.in-checked-path {
    color: var(--accent) !important;
    font-weight: 500 !important;
}

.el-cascader-node.is-checked {
    color: var(--accent) !important;
}

.el-checkbox__inner {
    background-color: var(--bg-elevated) !important;
    border-color: var(--border-default) !important;
}

.el-checkbox__input.is-checked .el-checkbox__inner {
    background-color: var(--accent) !important;
    border-color: var(--accent) !important;
}

/* ================================================
           SWITCH
           ================================================ */
.el-switch {
    --el-switch-off-color: var(--border-default);
    --el-switch-on-color: var(--accent);
    --el-switch-border-color: var(--border-subtle);
}

.el-switch__label {
    color: var(--text-tertiary) !important;
    font-size: 13px !important;
    font-family: var(--font-sans) !important;
}

.el-switch__label.is-active {
    color: var(--text-secondary) !important;
}

/* ================================================
           WARNING / ALERT BOX
           ================================================ */
.warning-box {
    background: var(--yellow-muted);
    border: 1px solid rgba(240, 160, 48, 0.2);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--yellow);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.6;
}

.warning-box .warning-icon {
    flex-shrink: 0;
    font-size: 16px;
    margin-top: 1px;
}

.warning-box strong {
    font-weight: 600;
}

/* ================================================
           FOOTER ACTION BAR
           ================================================ */
.action-bar {
    background: linear-gradient(180deg, var(--bg-surface) 0%, rgba(85, 96, 200, 0.03) 100%);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    box-shadow: var(--shadow-sm);
}

.action-bar .action-buttons {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
}

.action-bar .action-hint {
    font-size: 13px;
    color: var(--text-tertiary);
    text-align: center;
}

/* ================================================
           DIALOG — Refined modal
           ================================================ */
.el-dialog {
    background: var(--bg-surface) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-lg) !important;
    backdrop-filter: blur(20px) !important;
}

.el-dialog__header {
    border-bottom: 1px solid var(--border-subtle) !important;
    padding: 22px 28px !important;
}

.el-dialog__title {
    font-family: var(--font-sans) !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    color: var(--text-primary) !important;
}

.el-dialog__headerbtn .el-dialog__close {
    color: var(--text-tertiary) !important;
}

.el-dialog__headerbtn:hover .el-dialog__close {
    color: var(--text-primary) !important;
}

.el-dialog__body {
    padding: 24px 28px !important;
    color: var(--text-secondary) !important;
    font-size: 14px !important;
    line-height: 1.7 !important;
}

.el-dialog__footer {
    border-top: 1px solid var(--border-subtle) !important;
    padding: 18px 28px !important;
}

.el-dialog__footer .el-button {
    font-family: var(--font-sans) !important;
}

/* ================================================
           MARKDOWN BODY — Refined doc style
           ================================================ */
.markdown-body {
    background: transparent !important;
    color: var(--text-secondary) !important;
    padding: 32px 36px !important;
    max-height: none;
    overflow-y: visible;
    font-size: 15px;
    line-height: 1.8;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
    color: var(--text-primary) !important;
    border-bottom-color: var(--border-subtle) !important;
    padding-bottom: 10px;
    margin-top: 32px;
    margin-bottom: 16px;
}

.markdown-body h1 {
    font-size: 24px;
}
.markdown-body h2 {
    font-size: 20px;
}
.markdown-body h3 {
    font-size: 16px;
}

.markdown-body p {
    margin-bottom: 14px;
    color: var(--text-secondary);
}

.markdown-body code {
    background: var(--bg-elevated) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: 6px !important;
    padding: 2px 8px !important;
    font-family: var(--font-mono) !important;
    font-size: 13px !important;
    color: var(--text-primary) !important;
}

.markdown-body pre {
    background: var(--bg-elevated) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: var(--radius-md) !important;
    padding: 18px !important;
    overflow-x: auto;
}

.markdown-body pre code {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
}

.markdown-body a {
    color: var(--accent) !important;
    text-decoration: none !important;
    border-bottom: 1px solid var(--accent-muted);
    transition: border-color var(--transition-fast);
}

.markdown-body a:hover {
    border-bottom-color: var(--accent);
}

.markdown-body ul,
.markdown-body ol {
    padding-left: 24px !important;
    color: var(--text-secondary) !important;
    margin-bottom: 14px;
}

.markdown-body li {
    margin-bottom: 6px;
}

.markdown-body blockquote {
    border-left: 3px solid var(--accent) !important;
    background: var(--accent-muted) !important;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0 !important;
    padding: 14px 18px !important;
    margin: 14px 0 !important;
    color: var(--text-secondary) !important;
}

.markdown-body table {
    border-collapse: collapse;
    width: 100%;
    margin: 14px 0;
}

.markdown-body table th,
.markdown-body table td {
    border: 1px solid var(--border-subtle) !important;
    padding: 10px 14px !important;
    font-size: 13px;
}

.markdown-body table th {
    background: var(--bg-elevated) !important;
    color: var(--text-primary) !important;
    font-weight: 600;
}

.markdown-body table tr:nth-child(even) td {
    background: rgba(0, 0, 0, 0.04);
}

.markdown-body hr {
    border-color: var(--border-subtle) !important;
    margin: 24px 0;
}

/* ================================================
           GHOST DRAG
           ================================================ */
.ghost {
    opacity: 0.5;
    background: var(--accent-muted) !important;
    border-color: var(--accent) !important;
    border-style: dashed !important;
}

/* ================================================
           ELEMENT PLUS TOAST OVERRIDE
           ================================================ */
.el-message {
    background: var(--bg-surface) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-lg) !important;
    font-family: var(--font-sans) !important;
    backdrop-filter: blur(12px) !important;
}

.el-message__content {
    color: var(--text-secondary) !important;
    font-size: 13px !important;
}

/* ================================================
           LOADING BUTTON STATE
           ================================================ */
.btn[loading],
.btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

/* ================================================
           PREFERENCE ITEM ROW — Click-to-add items
           ================================================ */
.preference-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 13px;
    color: var(--text-secondary);
}
.preference-item-row:last-child {
    border-bottom: none;
}
.preference-item-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}
.preference-item-actions .action-want {
    color: var(--green);
    cursor: pointer;
    font-weight: bold;
    padding: 2px 6px;
    transition: opacity var(--transition-fast);
}
.preference-item-actions .action-want:hover {
    opacity: 0.7;
}
.preference-item-actions .action-avoid {
    color: var(--red);
    cursor: pointer;
    font-weight: bold;
    padding: 2px 6px;
    transition: opacity var(--transition-fast);
}
.preference-item-actions .action-avoid:hover {
    opacity: 0.7;
}

/* ================================================
           PREFERENCE SEARCH GRID — 2-column layout
           ================================================ */
.preference-search-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
.preference-search-label {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 6px;
}
.preference-search-label .count {
    color: var(--accent);
    font-weight: 600;
}

/* ================================================
           PREVIEW PLAN CARDS
           ================================================ */
.preview-plan-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    cursor: pointer;
    min-width: 220px;
    flex: 1 1 220px;
    max-width: 320px;
    transition: all var(--transition-fast);
}
.preview-plan-card.active {
    background: var(--bg-hover);
    border-color: var(--accent);
}
.preview-plan-card.loading {
    pointer-events: none;
}
.preview-plan-card.dimmed {
    opacity: 0.5;
    pointer-events: none;
}
.preview-plan-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
}
.preview-plan-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    cursor: text;
    display: flex;
    align-items: center;
    gap: 8px;
}
.preview-plan-meta {
    font-size: 12px;
    color: var(--text-tertiary);
    line-height: 1.6;
}
.preview-plan-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

/* ================================================
           PREVIEW HEADER BAR
           ================================================ */
.preview-header-bar {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    flex-shrink: 0;
}
.preview-header-bar .header-icon {
    margin-right: 8px;
}
.preview-header-bar .header-title {
    font-weight: 600;
    font-size: 14px;
}
.preview-header-bar .header-badge {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-tertiary);
    background: var(--bg-hover);
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 8px;
}

/* ================================================
           SCHOOL GROUP CARDS — "By School" drawer
           ================================================ */
.school-group-card {
    margin-bottom: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-default);
    background: var(--bg-elevated);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}
.school-group-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.school-group-card-header {
    padding: 14px 16px;
    background: linear-gradient(to right, var(--accent-muted), transparent);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.school-group-card-header .group-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.4;
}
.school-group-card-header .group-tags {
    display: flex;
    gap: 8px;
    align-items: center;
}
.school-group-card-header .group-count {
    font-size: 12px;
    color: var(--text-tertiary);
    background: var(--bg-hover);
    padding: 2px 8px;
    border-radius: 10px;
}
.school-group-majors {
    padding: 8px 16px 12px;
}
.school-group-majors .majors-header {
    display: flex;
    font-size: 12px;
    color: var(--text-tertiary);
    padding: 6px 0;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 4px;
    font-weight: 500;
}
.school-group-majors .major-row {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border-subtle);
    font-size: 13px;
    align-items: center;
    transition: background-color 0.2s;
}
.school-group-majors .major-row:hover {
    background-color: var(--bg-hover);
}
.school-group-majors .major-row:last-child {
    border-bottom: none;
}
.school-group-majors .major-name {
    flex: 1;
    color: var(--text-secondary);
    padding-right: 12px;
    line-height: 1.4;
}
.school-group-majors .major-plan {
    width: 50px;
    text-align: center;
    color: var(--text-secondary);
}
.school-group-majors .major-score {
    width: 60px;
    text-align: right;
    font-weight: 600;
    color: var(--accent);
}

/* ================================================
           FOOTER — Refined filing info
           ================================================ */
.site-footer {
    text-align: center;
    padding: 20px 0;
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}
.site-footer a {
    color: var(--text-tertiary);
    text-decoration: none;
    transition: color var(--transition-fast);
    padding: 2px 4px;
    border-radius: var(--radius-sm);
}
.site-footer a:hover {
    color: var(--text-secondary);
    background: var(--bg-hover);
}
.site-footer .footer-sep {
    color: var(--border-default);
    user-select: none;
}

/* ================================================
           MAJOR INFO BUTTON (? icon in preview table)
           ================================================ */
.major-info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent, #409eff);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    opacity: 0.6;
    transition:
        opacity 0.2s,
        transform 0.2s;
    line-height: 1;
}
.major-info-btn:hover {
    opacity: 1;
    transform: scale(1.15);
}

/* ================================================
           MAJOR INFO DRAWER
           ================================================ */
.major-drawer-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle, #ebeef5);
}
.major-drawer-section:last-child {
    border-bottom: none;
}
.major-drawer-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #303133);
    margin-bottom: 10px;
}
.major-drawer-info-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary, #606266);
}
.major-drawer-label {
    display: inline-block;
    width: 60px;
    color: var(--text-tertiary, #909399);
    font-size: 12px;
}

/* ================================================
           ADD GROUP DRAWER — Slide-in panel
           ================================================ */
.ag-drawer {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 480px;
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    animation: agSlideIn 0.28s ease both;
    z-index: 3000;
}
@keyframes agSlideIn {
    from {
        opacity: 0;
        transform: translateX(24px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.ag-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}
.ag-header-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--accent-muted);
    color: var(--accent);
    flex-shrink: 0;
}
.ag-header-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.3px;
}
.ag-header-close {
    margin-left: auto;
}

.ag-body {
    flex: 1;
    overflow: auto;
    padding: 20px;
}

/* Section cards */
.ag-section {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 16px;
    transition: border-color var(--transition-fast);
}
.ag-section:hover {
    border-color: var(--border-default);
}
.ag-section-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-tertiary);
    margin-bottom: 10px;
}

/* Conditions grid */
.ag-conditions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
}
.ag-conditions span::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent);
    margin-right: 6px;
    vertical-align: middle;
    opacity: 0.6;
}

/* Location bar */
.ag-location-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}
.ag-location-bar .ag-section-label {
    margin-bottom: 0;
    flex-shrink: 0;
}

/* Dual-column lists */
.ag-dual-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}
.ag-list-col-title {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.ag-list-col-count {
    font-size: 11px;
    font-weight: 500;
    color: var(--accent);
    background: var(--accent-muted);
    padding: 1px 6px;
    border-radius: 10px;
}
.ag-list-box {
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
}
.ag-option-row {
    padding: 12px 12px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 8px;
}
.ag-option-row:last-child {
    border-bottom: none;
}
.ag-option-row:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.ag-option-row:active {
    background: var(--accent-muted);
}
.ag-option-row::before {
    content: "+";
    font-size: 11px;
    font-weight: 700;
    color: var(--text-tertiary);
    opacity: 0;
    transition: opacity var(--transition-fast);
    flex-shrink: 0;
}
.ag-option-row:hover::before {
    opacity: 1;
    color: var(--accent);
}
.ag-option-disabled {
    cursor: default !important;
}
.ag-option-disabled:hover {
    background: transparent !important;
    color: var(--text-secondary) !important;
}
.ag-option-disabled:hover::before {
    opacity: 0 !important;
}
.ag-list-empty {
    padding: 20px 12px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 12px;
}

/* Selected majors box */
.ag-selected-box {
    background: var(--bg-surface);
    border: 1px dashed var(--border-default);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    min-height: 40px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    transition: border-color var(--transition-fast);
}
.ag-selected-box:hover {
    border-color: var(--accent);
}
.ag-selected-placeholder {
    color: var(--text-tertiary);
    font-size: 12px;
}

/* Search button — layout only, visual from .btn-primary */
.ag-search-btn {
    width: 100%;
    margin-bottom: 16px;
    padding: 7px 20px;
    font-size: 13px;
}

/* Results */
.ag-results-header {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.ag-results-count {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-tertiary);
}
.ag-results-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    font-family: var(--font-sans);
}
.ag-results-table .el-button {
    font-family: var(--font-sans) !important;
}
.ag-results-table thead th {
    padding: 8px 10px;
    background: var(--bg-hover);
    color: var(--text-tertiary);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
}
.ag-results-table thead th:not(:last-child) {
    border-right: 1px solid var(--border-subtle);
}
.ag-results-table tbody td {
    padding: 8px 10px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-subtle);
}
.ag-results-table tbody td:not(:last-child) {
    border-right: 1px solid var(--border-subtle);
}
.ag-results-table tbody tr:last-child td {
    border-bottom: none;
}
.ag-results-table tbody tr {
    transition: background var(--transition-fast);
}
.ag-results-table tbody tr:hover {
    background: var(--bg-hover);
}
.ag-results-table .ag-col-school {
    font-weight: 500;
    color: var(--text-primary);
}
.ag-results-table .ag-col-major {
    font-weight: 600;
    color: var(--green);
}
.ag-results-table .ag-col-center {
    text-align: center;
}
.ag-results-table tr.ag-row-added {
    opacity: 0.45;
}
.ag-results-table tr.ag-row-added .ag-col-major {
    color: var(--text-tertiary);
}

.ag-empty-state {
    padding: 48px 0;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 13px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.ag-empty-state svg {
    opacity: 0.3;
}
