/**
 * 专升本专业查询系统 - 样式文件
 */

/* ========== 基础样式 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding-bottom: 20px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========== 头部区域 ========== */
.header {
    background: url('/assets/img/zhuanben-banner.jpg') center/cover;
    background-color: #4a90e2;
    padding: 40px 20px;
    text-align: center;
    color: white;
    position: relative;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.9) 100%);
}

.header h1 {
    font-size: 28px;
    margin-bottom: 10px;
    font-weight: bold;
    position: relative;
    z-index: 1;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.header p {
    font-size: 14px;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

/* ========== 搜索框 ========== */
.search-box {
    padding: 20px;
    background: white;
    margin: -30px 15px 15px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 10;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    padding: 15px 90px 15px 45px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    transition: all 0.3s;
}

.search-input:focus {
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 18px;
}

.search-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: #4a90e2;
    border: none;
    color: white;
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.search-btn:hover {
    background: #357abd;
}

.clear-btn {
    position: absolute;
    right: 80px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    font-size: 18px;
    cursor: pointer;
    display: none;
    padding: 5px;
}

.clear-btn.show {
    display: block;
}

/* ========== 加载状态 ========== */
.loading {
    text-align: center;
    padding: 40px;
    color: white;
    display: none;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========== 空状态提示 ========== */
.empty-tip {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.empty-tip .icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.6;
}

/* ========== 搜索结果列表 ========== */
.result-list {
    margin: 0 15px;
}

.result-item {
    background: white;
    padding: 18px 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
}

.result-item:active {
    transform: scale(0.98);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.result-item .major-code {
    color: #4a90e2;
    font-weight: bold;
    margin-right: 10px;
    font-size: 14px;
    min-width: 80px;
}

.result-item .major-name {
    color: #333;
    font-size: 16px;
    flex: 1;
}

.result-item .subcategory {
    color: #666;
    font-size: 12px;
    background: #f0f0f0;
    padding: 3px 8px;
    border-radius: 4px;
    margin-left: 10px;
}

.result-item .arrow {
    color: #ccc;
    font-size: 24px;
    margin-left: 10px;
}

/* ========== 详情页面 ========== */
.detail-container {
    display: none;
    background: white;
    margin: 0 15px 15px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.detail-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 20px;
}

.detail-header .tags {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.tag {
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.tag-green {
    background: #52c41a;
    color: white;
}

.tag-blue {
    background: #1890ff;
    color: white;
}

.tag-code {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
}

.detail-header h2 {
    font-size: 20px;
    font-weight: bold;
    margin: 0;
}

.detail-content {
    padding: 20px;
}

/* ========== 区块样式 ========== */
.section {
    margin-bottom: 25px;
}

.section:last-child {
    margin-bottom: 0;
}

.section-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
    padding-left: 12px;
    border-left: 3px solid #4a90e2;
}

/* ========== 本科专业列表 ========== */
.bachelor-list {
    display: grid;
    gap: 10px;
}

.bachelor-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 3px solid #4a90e2;
}

.bachelor-name {
    font-size: 15px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.employment-tip {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

/* ========== 考试科目表格 ========== */
.subject-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.subject-table thead {
    background: #52c41a;
    color: white;
}

.subject-table th {
    padding: 14px;
    text-align: center;
    font-weight: bold;
    font-size: 15px;
}

.subject-table td {
    padding: 15px;
    border: 1px solid #e0e0e0;
    vertical-align: top;
}

.subject-cell {
    background: #fafafa;
}

.subject-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed #e0e0e0;
}

.subject-item:last-child {
    border-bottom: none;
}

.subject-name {
    color: #333;
    font-size: 14px;
}

.subject-score {
    color: #4a90e2;
    font-weight: bold;
    font-size: 14px;
}

.no-data {
    color: #999;
    font-size: 13px;
}

/* ========== 分数线表格 ========== */
.score-table-wrapper {
    overflow-x: auto;
}

.score-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.score-table thead {
    background: #52c41a;
    color: white;
}

.score-table th {
    padding: 12px 10px;
    font-size: 14px;
    white-space: nowrap;
}

.score-table td {
    padding: 12px 10px;
    border: 1px solid #e0e0e0;
    text-align: center;
}

.category-name {
    font-weight: bold;
    color: #333;
    background: #fafafa;
}

.score-value {
    font-size: 18px;
    font-weight: bold;
    color: #4a90e2;
}

/* ========== 招生院校表格 ========== */
.enrollment-table-wrapper {
    overflow-x: auto;
}

.enrollment-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.enrollment-table thead {
    background: #52c41a;
    color: white;
}

.enrollment-table th {
    padding: 12px 8px;
    font-size: 13px;
    white-space: nowrap;
}

.enrollment-table td {
    padding: 12px 8px;
    border: 1px solid #e0e0e0;
}

.university-cell {
    text-align: left;
}

.university-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    color: white;
}

.type-公办 {
    background: #52c41a;
}

.type-民办 {
    background: #fa8c16;
}

.type-独立学院 {
    background: #722ed1;
}

.major-cell {
    color: #333;
    font-weight: 500;
}

.plan-cell {
    text-align: center;
    font-weight: bold;
    color: #333;
}

.no-plan {
    color: #ccc;
    font-weight: normal;
}

/* ========== 返回按钮 ========== */
.back-btn {
    position: fixed;
    top: 15px;
    left: 15px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    color: #333;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-btn:active {
    transform: scale(0.95);
    background: white;
}

/* ========== Toast提示 ========== */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* ========== 响应式设计 ========== */
@media (max-width: 768px) {
    .header {
        padding: 30px 15px;
    }
    
    .header h1 {
        font-size: 24px;
    }
    
    .search-box {
        margin: -25px 10px 10px;
    }
    
    .result-list {
        margin: 0 10px;
    }
    
    .detail-container {
        margin: 0 10px 10px;
    }
    
    .subject-table th,
    .subject-table td {
        padding: 10px 8px;
        font-size: 13px;
    }
    
    .enrollment-table {
        font-size: 12px;
    }
}

/* ========== 动画效果 ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-item {
    animation: fadeIn 0.3s ease-out;
}

.result-item:nth-child(1) { animation-delay: 0.05s; }
.result-item:nth-child(2) { animation-delay: 0.1s; }
.result-item:nth-child(3) { animation-delay: 0.15s; }
.result-item:nth-child(4) { animation-delay: 0.2s; }
.result-item:nth-child(5) { animation-delay: 0.25s; }
