/* =====================================================
   志愿填报管理系统 - 核心样式
   ===================================================== */

:root {
    --primary: #4f6df5;
    --primary-dark: #3b56c9;
    --primary-light: #eef1ff;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --sidebar-width: 240px;
    --sidebar-collapsed: 64px;
    --header-height: 56px;
    --radius: 8px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
    --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
    --transition: all .2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--gray-100);
    color: var(--gray-800);
    font-size: 14px;
    line-height: 1.6;
}

/* ============ Layout ============ */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ============ Sidebar ============ */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    color: #cbd5e1;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    overflow-y: auto;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: var(--header-height);
}

.sidebar-logo {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.sidebar-title {
    font-size: 15px;
    font-weight: 600;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-nav {
    flex: 1;
    padding: 8px 0;
}

.nav-section-title {
    padding: 12px 20px 4px;
    font-size: 11px;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: .5px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: #94a3b8;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 14px;
    gap: 10px;
}

.nav-item:hover {
    background: rgba(255,255,255,.05);
    color: #e2e8f0;
}

.nav-item.active {
    background: rgba(79,109,245,.15);
    color: var(--primary);
    border-right: 3px solid var(--primary);
}

.nav-item .nav-icon {
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    font-size: 16px;
}

.nav-item .nav-text {
    white-space: nowrap;
}

.nav-arrow {
    margin-left: auto;
    transition: transform .2s;
    font-size: 12px;
}

.nav-arrow.collapsed {
    transform: rotate(-90deg);
}

.nav-submenu {
    overflow: hidden;
    max-height: 0;
    transition: max-height .3s ease;
}

.nav-submenu.open {
    max-height: 500px;
}

.nav-submenu .nav-item {
    padding-left: 50px;
    font-size: 13px;
}

.sidebar-footer {
    padding: 12px 20px;
    border-top: 1px solid rgba(255,255,255,.08);
    font-size: 12px;
    color: #64748b;
}

/* ============ Main Content ============ */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

/* ============ Header ============ */
.top-header {
    height: var(--header-height);
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 999;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--gray-700);
    padding: 4px 8px;
}

.page-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-dropdown {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
}

.user-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 160px;
    display: none;
    z-index: 1001;
}

.user-menu.show {
    display: block;
}

.user-menu a {
    display: block;
    padding: 8px 16px;
    color: var(--gray-700);
    text-decoration: none;
    transition: var(--transition);
}

.user-menu a:hover {
    background: var(--gray-100);
}

.user-menu .divider {
    height: 1px;
    background: var(--gray-200);
    margin: 4px 0;
}

/* ============ Content Area ============ */
.content-area {
    flex: 1;
    padding: 24px;
}

.page-header {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
}

.page-header .actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ============ Card ============ */
.card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-800);
}

.card-body {
    padding: 20px;
}

/* ============ Buttons ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

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

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-warning {
    background: var(--warning);
    color: #fff;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
}

.btn-outline:hover {
    background: var(--gray-100);
}

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

.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* ============ Tables ============ */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

table.data-table th {
    background: var(--gray-50);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--gray-600);
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
    position: sticky;
    top: 0;
}

table.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
    vertical-align: middle;
}

table.data-table tbody tr:hover {
    background: var(--gray-50);
}

table.data-table .actions-cell {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
}

/* ============ Forms ============ */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--gray-700);
    font-size: 14px;
}

.form-group label .required {
    color: var(--danger);
    margin-left: 2px;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 14px;
    transition: var(--transition);
    background: #fff;
    color: var(--gray-800);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,109,245,.1);
}

.form-control:disabled {
    background: var(--gray-100);
    cursor: not-allowed;
}

textarea.form-control {
    min-height: 80px;
    resize: vertical;
}

select.form-control {
    cursor: pointer;
    appearance: auto;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.form-section {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    background: #fff;
}

.form-section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-section-title .badge-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

/* ============ Badges ============ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
}

.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: #dcfce7; color: #15803d; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-info { background: #dbeafe; color: #1d4ed8; }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }

/* ============ Toggle Switch ============ */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gray-300);
    transition: .3s;
    border-radius: 22px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background: var(--primary);
}

input:checked + .toggle-slider:before {
    transform: translateX(18px);
}

/* ============ Modal ============ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,.5);
    z-index: 9999;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
    overflow-y: auto;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 800px;
    box-shadow: var(--shadow-lg);
    animation: modalSlide .3s ease;
    margin: auto;
}

.modal.modal-lg {
    max-width: 1100px;
}

.modal.modal-sm {
    max-width: 480px;
}

@keyframes modalSlide {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
}

.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--gray-500);
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.modal-body {
    padding: 20px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ============ Pagination ============ */
.pagination-wrap {
    display: flex;
    justify-content: center;
    padding: 16px 0;
}

.pagination {
    display: flex;
    list-style: none;
    gap: 4px;
}

.page-item.disabled .page-link {
    color: var(--gray-400);
    pointer-events: none;
}

.page-link {
    display: block;
    padding: 6px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    text-decoration: none;
    color: var(--gray-700);
    transition: var(--transition);
}

.page-item.active .page-link {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.page-link:hover:not(.active) {
    background: var(--gray-100);
}

/* ============ Search Bar ============ */
.search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.search-bar .form-control {
    width: auto;
    min-width: 200px;
}

/* ============ Empty State ============ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-500);
}

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: .5;
}

/* ============ Alert ============ */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.alert-danger { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-warning { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.alert-info { background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; }

/* ============ Tabs ============ */
.tabs {
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 20px;
    display: flex;
    gap: 0;
    overflow-x: auto;
}

.tab-item {
    padding: 10px 20px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    color: var(--gray-600);
    font-weight: 500;
    white-space: nowrap;
    transition: var(--transition);
    margin-bottom: -2px;
}

.tab-item:hover {
    color: var(--primary);
}

.tab-item.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* ============ Read Status ============ */
.read-status-unread {
    color: var(--danger);
    font-weight: 600;
}

.read-status-read {
    color: var(--gray-400);
}

/* ============ Priority Dot ============ */
.priority-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.priority-dot.urgent { background: var(--danger); }
.priority-dot.important { background: var(--warning); }
.priority-dot.normal { background: var(--success); }

/* ============ Responsive ============ */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-menu-btn {
        display: flex;
        align-items: center;
    }

    .content-area {
        padding: 16px;
    }

    .page-header h2 {
        font-size: 18px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    table.data-table {
        font-size: 13px;
    }

    table.data-table th,
    table.data-table td {
        padding: 8px 10px;
    }

    .modal {
        margin: 10px;
    }

    .modal-body {
        padding: 16px;
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,.4);
        z-index: 999;
        display: none;
    }

    .sidebar-overlay.show {
        display: block;
    }

    .search-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-bar .form-control {
        width: 100%;
    }

    .hide-mobile {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .btn-sm {
        padding: 3px 8px;
        font-size: 11px;
    }

    .content-area {
        padding: 12px;
    }
}

/* ============ Utilities ============ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--primary); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-gray { color: var(--gray-500); }
.font-bold { font-weight: 700; }
.font-semi { font-weight: 600; }
.text-sm { font-size: 12px; }
.text-lg { font-size: 16px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.cursor-pointer { cursor: pointer; }
.rounded { border-radius: var(--radius); }
.shadow { box-shadow: var(--shadow); }

/* =====================================================
   门户站点布局样式
   ===================================================== */

/* ============ 顶部联系栏 ============ */
.topbar {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 12px;
    color: #64748b;
    padding: 6px 0;
}
.topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.topbar-right a {
    color: #64748b;
    text-decoration: none;
    transition: color .2s;
}
.topbar-right a:hover { color: var(--primary); }
.topbar-divider {
    margin: 0 6px;
    color: #cbd5e1;
}

/* ============ 主导航栏 ============ */
.portal-header {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    position: sticky;
    top: 0;
    z-index: 999;
    border-bottom: 1px solid #e2e8f0;
}
.portal-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 64px;
    display: flex;
    align-items: center;
    gap: 24px;
}

/* Logo */
.portal-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}
.portal-logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
}
.portal-brand-text { line-height: 1.3; }
.portal-brand-name {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
}
.portal-brand-sub {
    font-size: 11px;
    color: #94a3b8;
}

/* 导航链接 */
.portal-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}
.portal-nav-link {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    color: #475569;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all .2s;
    white-space: nowrap;
    cursor: pointer;
}
.portal-nav-link:hover,
.portal-nav-link.active {
    color: var(--primary);
    background: rgba(79,109,245,.08);
}
.portal-nav-arrow {
    font-size: 10px;
    transition: transform .2s;
}
.portal-nav-item.open .portal-nav-arrow {
    transform: rotate(180deg);
}

/* 下拉菜单 */
.portal-nav-item {
    position: relative;
}
.portal-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 200px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,.12);
    border: 1px solid #e2e8f0;
    padding: 8px;
    display: none;
    z-index: 1000;
}
.portal-dropdown.show { display: block; }
.portal-dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 20px;
    width: 12px;
    height: 12px;
    background: #fff;
    border-left: 1px solid #e2e8f0;
    border-top: 1px solid #e2e8f0;
    transform: rotate(45deg);
}
.portal-dropdown-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: #475569;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    transition: all .2s;
}
.portal-dropdown-link:hover {
    background: #f1f5f9;
    color: var(--primary);
}
.portal-dropdown-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* 右侧操作 */
.portal-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.portal-auth {
    display: flex;
    gap: 8px;
}
.portal-auth-btn {
    padding: 7px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all .2s;
}
.portal-auth-login {
    color: var(--primary);
    background: transparent;
    border: 1px solid var(--primary);
}
.portal-auth-login:hover {
    background: var(--primary);
    color: #fff;
}
.portal-auth-register {
    color: #fff;
    background: var(--primary);
}
.portal-auth-register:hover {
    background: var(--primary-dark);
}

/* 用户区域 */
.portal-user {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background .2s;
}
.portal-user:hover { background: var(--gray-100); }
.portal-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}
.portal-user-name {
    font-size: 14px;
    color: #475569;
    font-weight: 500;
}
.portal-user-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,.12);
    min-width: 180px;
    padding: 6px;
    display: none;
    z-index: 1001;
}
.portal-user-menu.show { display: block; }
.portal-user-menu a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    color: #475569;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    transition: background .15s;
}
.portal-user-menu a:hover { background: #f1f5f9; }
.portal-user-menu-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 4px 0;
}

.portal-mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #475569;
    padding: 4px 8px;
}

/* ============ 主体区域 ============ */
.portal-main {
    min-height: calc(100vh - 64px - 38px);
}

/* ============ 门户首页 Hero ============ */
.portal-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 60px 20px 50px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.portal-hero::after {
    content: '';
    position: absolute;
    bottom: -30px;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--gray-100);
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.portal-hero-inner {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}
.portal-hero h1 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: 2px;
}
.portal-hero .subtitle {
    font-size: 16px;
    opacity: .9;
    margin-bottom: 24px;
}
.portal-hero-search {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,.2);
}
.portal-hero-search input {
    flex: 1;
    border: none;
    padding: 14px 20px;
    font-size: 15px;
    outline: none;
    color: #333;
}
.portal-hero-search button {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 0 28px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}
.portal-hero-search button:hover { background: var(--primary-dark); }
.portal-hero-countdown {
    margin-top: 20px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,.15);
    padding: 8px 20px;
    border-radius: 24px;
    backdrop-filter: blur(10px);
}
.portal-hero-countdown .num {
    font-size: 24px;
    font-weight: 800;
}
.portal-hero-countdown .label {
    font-size: 13px;
    opacity: .9;
}

/* ============ 门户内容容器 ============ */
.portal-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 20px;
}
.portal-section {
    margin-bottom: 40px;
}
.portal-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.portal-section-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}
.portal-section-more {
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}
.portal-section-more:hover { text-decoration: underline; }

/* ============ 快捷入口网格 ============ */
.portal-quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}
.portal-quick-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 28px 16px;
    background: #fff;
    border-radius: 16px;
    text-decoration: none;
    color: inherit;
    border: 1px solid #e2e8f0;
    transition: all .3s;
    position: relative;
    overflow: hidden;
}
.portal-quick-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--gradient, linear-gradient(90deg, #667eea, #764ba2));
    opacity: 0;
    transition: opacity .3s;
}
.portal-quick-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 32px rgba(0,0,0,.1);
    border-color: transparent;
}
.portal-quick-card:hover::before { opacity: 1; }
.portal-quick-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin-bottom: 14px;
    transition: transform .3s;
}
.portal-quick-card:hover .portal-quick-icon { transform: scale(1.1); }
.portal-quick-title {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}
.portal-quick-desc {
    font-size: 12px;
    color: #94a3b8;
    text-align: center;
}
.bg-blue { background: linear-gradient(135deg, #dbeafe, #bfdbfe); color: #2563eb; }
.bg-green { background: linear-gradient(135deg, #dcfce7, #bbf7d0); color: #16a34a; }
.bg-purple { background: linear-gradient(135deg, #f3e8ff, #e9d5ff); color: #9333ea; }
.bg-orange { background: linear-gradient(135deg, #fed7aa, #fdba74); color: #ea580c; }
.bg-pink { background: linear-gradient(135deg, #fce7f3, #fbcfe8); color: #db2777; }
.bg-teal { background: linear-gradient(135deg, #ccfbf1, #99f6e4); color: #0d9488; }
.bg-yellow { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #ca8a04; }
.bg-indigo { background: linear-gradient(135deg, #e0e7ff, #c7d2fe); color: #4f46e5; }
.bg-red { background: linear-gradient(135deg, #fee2e2, #fecaca); color: #dc2626; }
.bg-cyan { background: linear-gradient(135deg, #cffafe, #a5f3fc); color: #0891b2; }

/* ============ 统计数据条 ============ */
.portal-stats-bar {
    display: flex;
    justify-content: center;
    gap: 48px;
    padding: 24px 20px;
    flex-wrap: wrap;
}
.portal-stat-item { text-align: center; }
.portal-stat-num {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
}
.portal-stat-label {
    font-size: 13px;
    color: #64748b;
    margin-top: 2px;
}

/* ============ 双栏布局 ============ */
.portal-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* ============ 新闻列表 ============ */
.portal-news-list { list-style: none; }
.portal-news-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}
.portal-news-list li:last-child { border-bottom: none; }
.portal-news-tag {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}
.portal-news-title {
    flex: 1;
    color: #334155;
    text-decoration: none;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.portal-news-title:hover { color: var(--primary); }
.portal-news-date {
    color: #94a3b8;
    font-size: 12px;
    white-space: nowrap;
}

/* ============ 快捷按钮组 ============ */
.portal-quick-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ============ 升学月历 ============ */
.portal-month-calendar {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
    margin-bottom: 16px;
}
.portal-month-item {
    text-align: center;
    padding: 10px 4px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #64748b;
    transition: all .2s;
    border: 1px solid transparent;
}
.portal-month-item:hover, .portal-month-item.active {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
    font-weight: 600;
}
.portal-month-detail {
    background: #f8fafc;
    border-radius: 8px;
    padding: 16px;
    font-size: 13px;
    line-height: 1.8;
    color: #475569;
}

/* ============ 院校推荐卡片 ============ */
.portal-recommend-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    transition: background .2s;
}
.portal-recommend-card:hover { background: #f8fafc; }
.portal-recommend-tag {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}
.tag-chong { background: #fee2e2; color: #dc2626; }
.tag-wen { background: #dcfce7; color: #16a34a; }
.tag-bao { background: #dbeafe; color: #2563eb; }
.portal-recommend-info { flex: 1; }
.portal-recommend-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}
.portal-recommend-score {
    font-size: 12px;
    color: #94a3b8;
}

/* ============ 底部 ============ */
.portal-footer {
    background: #1e293b;
    color: #94a3b8;
    padding: 40px 0 20px;
    margin-top: auto;
}
.portal-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}
.portal-footer-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 32px;
    margin-bottom: 32px;
}
.portal-footer-col h4 {
    color: #e2e8f0;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}
.portal-footer-col a {
    display: block;
    color: #94a3b8;
    text-decoration: none;
    font-size: 13px;
    padding: 3px 0;
    transition: color .2s;
}
.portal-footer-col a:hover { color: #fff; }
.portal-footer-col p {
    font-size: 13px;
    margin: 4px 0;
}
.portal-footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,.08);
    font-size: 12px;
    color: #64748b;
}

/* ============ 门户响应式 ============ */
.portal-nav-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.4);
    z-index: 998;
}
.portal-nav-overlay.show { display: block; }

@media (max-width: 1024px) {
    .portal-nav { gap: 2px; }
    .portal-nav-link { padding: 8px 10px; font-size: 13px; }
    .portal-footer-grid { grid-template-columns: repeat(3, 1fr); }
    .portal-two-col { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .topbar-left span:not(:first-child) { display: none; }
    .portal-header-inner { gap: 12px; }
    .portal-brand-text { display: none; }
    .portal-nav {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        background: #fff;
        flex-direction: column;
        align-items: stretch;
        padding: 80px 16px 16px;
        z-index: 999;
        transform: translateX(-100%);
        transition: transform .3s;
        overflow-y: auto;
        gap: 0;
    }
    .portal-nav.mobile-open { transform: translateX(0); }
    .portal-nav-link { padding: 14px 16px; border-radius: 8px; }
    .portal-nav-item { width: 100%; }
    .portal-dropdown {
        position: static;
        box-shadow: none;
        border: none;
        padding: 0 0 0 20px;
        display: none;
    }
    .portal-dropdown.show { display: block; }
    .portal-dropdown::before { display: none; }
    .portal-mobile-toggle { display: block; }
    .portal-hero h1 { font-size: 24px; }
    .portal-hero .subtitle { font-size: 13px; }
    .portal-hero-search { flex-direction: column; }
    .portal-hero-search input { padding: 12px 16px; }
    .portal-hero-search button { padding: 12px; }
    .portal-quick-grid { grid-template-columns: repeat(2, 1fr); }
    .portal-stats-bar { gap: 20px; }
    .portal-stat-num { font-size: 20px; }
    .portal-section-header h2 { font-size: 18px; }
    .portal-footer-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
    .portal-month-calendar { grid-template-columns: repeat(4, 1fr); }
    .hide-mobile { display: none !important; }
}

@media (max-width: 480px) {
    .portal-quick-grid { grid-template-columns: 1fr 1fr; }
    .portal-hero { padding: 40px 16px 30px; }
    .portal-hero h1 { font-size: 20px; }
    .portal-container { padding: 20px 12px; }
    .portal-footer-grid { grid-template-columns: 1fr; }
}

