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

body {
    font-family: 'Inter', 'Noto Sans SC', sans-serif;
    background-color: #0b0f19;
    color: #e2e8f0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* 单个查询项卡片 */
.query-item {
    background: #1e293b;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    flex-wrap: wrap; /* 允许内容换行 */
}

/* 院校左侧信息容器 */
.uni-info-container {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

.uni-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* 预计开放时间小字 */
.uni-time {
    font-size: 13px;
    color: #94a3b8;
    margin-left: 55px; /* 与文字对齐 (40px icon + 15px gap) */
}

/* 底部操作按钮容器 */
.uni-buttons {
    display: flex;
    gap: 10px;
    margin-left: 15px;
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(10px); }
    to { opacity: 1; transform: translateX(0); }
}

.btn-link {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-link-secondary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}
.btn-link-secondary:hover {
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.background-effects {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.5;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: #3b82f6;
    top: -100px;
    left: -100px;
    animation: float 10s infinite ease-in-out alternate;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: #8b5cf6;
    bottom: -150px;
    right: -100px;
    animation: float 12s infinite ease-in-out alternate-reverse;
}

@keyframes float {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.container {
    width: 90%;
    max-width: 800px;
    height: 85vh;
    background: rgba(17, 24, 39, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 40px rgba(59, 130, 246, 0.1);
    overflow: hidden;
}

header {
    padding: 30px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.03), transparent);
    position: relative;
    z-index: 20;
}

header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #60a5fa, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

header p {
    font-size: 0.95rem;
    color: #94a3b8;
    font-weight: 400;
    margin-bottom: 16px;
}

/* 搜索栏样式 */
.search-bar {
    display: flex;
    justify-content: center;
    gap: 10px;
    max-width: 400px;
    margin: 0 auto;
    position: relative;
}

.search-bar input {
    flex: 1;
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    color: #f8fafc;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s;
    -webkit-appearance: none;
    appearance: none;
}

.search-bar input.error-placeholder::placeholder {
    color: #ef4444;
}

.search-bar input:focus {
    border-color: #3b82f6;
    background: rgba(0, 0, 0, 0.4);
}

.search-bar button {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.3s, transform 0.1s;
}

.search-bar button:hover {
    opacity: 0.9;
}

.search-bar button:active {
    transform: scale(1.1);
}

/* 模糊查询下拉建议 */
.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    width: calc(100% - 70px);
    margin-top: 8px;
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    max-height: 250px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    flex-direction: column;
}

.autocomplete-suggestion-item {
    padding: 10px 16px;
    color: #e2e8f0;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s;
}

.autocomplete-suggestion-item:hover {
    background: rgba(59, 130, 246, 0.2);
}

.autocomplete-suggestions::-webkit-scrollbar { width: 6px; }
.autocomplete-suggestions::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.1); }
.autocomplete-suggestions::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 10px; }

main {
    flex: 1;
    padding: 20px 30px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* 置顶区样式 */
.pinned-panel {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    /* 保持约 3 个院校的显示位置 (3 * 76px 约 228px)，加入自由滚动 */
    max-height: 230px; 
    overflow-y: auto;
    scroll-behavior: smooth;
}

.pinned-panel:not(:empty) {
    padding-bottom: 5px;
    margin-bottom: 10px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
}

.pinned-panel::-webkit-scrollbar { width: 4px; }
.pinned-panel::-webkit-scrollbar-track { background: transparent; }
.pinned-panel::-webkit-scrollbar-thumb { background: rgba(16, 185, 129, 0.3); border-radius: 10px; }
.pinned-panel::-webkit-scrollbar-thumb:hover { background: rgba(16, 185, 129, 0.6); }

/* Scroll shadow indicators */
main::before, main::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 30px;
    z-index: 10;
    pointer-events: none;
}
main::before {
    top: 0;
    background: linear-gradient(to bottom, rgba(17, 24, 39, 0.9), transparent);
}
main::after {
    bottom: 0;
    background: linear-gradient(to top, rgba(17, 24, 39, 0.9), transparent);
}

.query-panel {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 20px;
    padding-top: 10px;
    scroll-behavior: smooth;
    position: relative;
}

.query-panel::-webkit-scrollbar {
    width: 6px;
}
.query-panel::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}
.query-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}
.query-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* 查询项样式 */
.query-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border-left: 4px solid transparent;
    transition: all 0.4s ease;
    animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(20px);
}

.query-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.query-item.pending {
    border-left-color: #475569;
    opacity: 0.6;
}

.query-item.about-to-query {
    border-left-color: #fbbf24;
}

.query-item.querying {
    border-left-color: #10b981;
    background: rgba(16, 185, 129, 0.05);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.05);
}

.query-item.completed {
    border-left-color: #ef4444; 
}

/* 已开放（成功）状态样式 */
.query-item.success {
    border-left-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.uni-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.uni-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.02));
    border: 1px solid rgba(255,255,255,0.05);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    font-weight: 600;
    color: #e2e8f0;
}

.uni-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: #f8fafc;
    letter-spacing: 0.5px;
    transition: font-size 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.3s ease;
    line-height: 1.2;
}

.query-item.pending .uni-name { color: #94a3b8; }
.query-item.about-to-query .uni-name { color: #fbbf24; }
.query-item.querying .uni-name { font-size: 4.2rem; color: #10b981; }

.status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    position: relative;
}

/* 状态颜色 */
.status-pending { color: #64748b; }
.status-about-to-query { color: #fbbf24; }
.status-querying { color: #10b981; }
.status-closed { color: #ef4444; }
.status-success { color: #10b981; }

/* 允许修改状态时的点击效果 */
.status.clickable {
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.status.clickable:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* 状态修改下拉/内联选项 */
.status-options {
    display: flex;
    gap: 8px;
}
.status-option-btn {
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}
.status-option-btn:hover {
    background: rgba(255,255,255,0.1);
}
.status-option-btn.btn-open {
    border-color: #10b981;
    color: #10b981;
}
.status-option-btn.btn-close {
    border-color: #ef4444;
    color: #ef4444;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(16, 185, 129, 0.3);
    border-top-color: #10b981;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

footer {
    padding: 18px 30px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.status-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 0.85rem;
    color: #94a3b8;
    font-weight: 600;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 10px #10b981;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Toast 悬浮提示框 */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.toast.toast-success {
    border-left: 4px solid #10b981;
}

.toast.toast-error {
    border-left: 4px solid #ef4444;
}

/* Modal 弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: #1e1e1e;
    border: 1px solid #ef4444;
    border-radius: 12px;
    padding: 30px 40px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(239, 68, 68, 0.2);
    max-width: 400px;
    color: #f8fafc;
}

.modal-content h2 {
    color: #ef4444;
    margin-bottom: 15px;
}
