* { box-sizing: border-box; }
body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
    margin: 0;
}
.main-container {
    max-width: 1400px;
    margin: 0 auto;
}
.search-box {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
.search-title {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}
.search-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 15px;
}
.search-row:last-child { margin-bottom: 0; }
.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.form-group label {
    font-size: 13px;
    color: #666;
}
.form-group input, .form-group select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}
.form-group input:focus, .form-group select:focus {
    border-color: #667eea;
}
.form-group.small { width: 80px; }
.form-group.medium { width: 120px; }
.form-group.large { flex: 1; min-width: 200px; }
.keyword-wrapper {
    flex: 1;
    min-width: 250px;
    position: relative;
}
.keyword-wrapper input {
    width: 100%;
    padding-right: 30px;
}
.keyword-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #999;
    font-size: 16px;
    display: none;
}
.keyword-wrapper input:not(:placeholder-shown) + .keyword-clear {
    display: block;
}
.keyword-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}
.keyword-suggestions.show { display: block; }
.suggestion-group {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}
.suggestion-group:last-child { border-bottom: none; }
.suggestion-title {
    padding: 4px 12px;
    font-size: 12px;
    color: #999;
    background: #f9f9f9;
}
.suggestion-item {
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.2s;
}
.suggestion-item:hover { background: #f0f5ff; }
.suggestion-item .name { font-weight: 500; }
.suggestion-item .info { font-size: 12px; color: #999; margin-top: 2px; }
.btn-search {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 8px 25px;
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s;
    height: 38px;
}
.btn-search:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}
.btn-reset {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    height: 38px;
}
.btn-export {
    background: #52c41a;
    color: #fff;
    border: none;
    padding: 6px 15px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
}
.btn-export:hover {
    background: #389e0d;
}
.major-table-wrapper {
    overflow-x: auto;
}
.major-result-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #666;
    position: sticky;
    top: 0;
    z-index: 1;
}
.major-result-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: #fff;
    table-layout: fixed;
}
.major-result-table th, .major-result-table td {
    padding: 10px 8px;
    text-align: center;
    border-bottom: 1px solid #eee;
}
.major-result-table th:first-child, .major-result-table td:first-child,
.major-result-table th:nth-child(2), .major-result-table td:nth-child(2) {
    text-align: left;
}
.major-result-table th:nth-child(1), .major-result-table td:nth-child(1) { width: 18%; }
.major-result-table th:nth-child(2), .major-result-table td:nth-child(2) { width: 22%; }
.major-result-table th:nth-child(3), .major-result-table td:nth-child(3) { width: 7%; }
.major-result-table th:nth-child(4), .major-result-table td:nth-child(4) { width: 8%; }
.major-result-table th:nth-child(5), .major-result-table td:nth-child(5) { width: 7%; }
.major-result-table th:nth-child(6), .major-result-table td:nth-child(6) { width: 7%; }
.major-result-table th:nth-child(7), .major-result-table td:nth-child(7) { width: 7%; }
.major-result-table th:nth-child(8), .major-result-table td:nth-child(8) { width: 12%; }
.major-result-table th:nth-child(9), .major-result-table td:nth-child(9) { width: 12%; }
.major-result-table tr:hover td {
    background: #f9f9f9;
}
.major-result-table .zy-cell {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.filter-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    display: none;
}
.filter-section.show { display: block; }
.filter-toggle {
    text-align: center;
    margin-top: 10px;
}
.filter-toggle a {
    color: #667eea;
    text-decoration: none;
    font-size: 13px;
}
.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}
.filter-row:last-child { margin-bottom: 0; }
.filter-label {
    width: 70px;
    font-size: 13px;
    color: #666;
    padding-top: 6px;
    flex-shrink: 0;
}
.filter-options {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.filter-options a {
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    text-decoration: none;
    font-size: 12px;
    transition: all 0.2s;
}
.filter-options a.active {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}
.tabs-box {
    background: #fff;
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
.tabs-header {
    display: flex;
    border-bottom: 1px solid #eee;
}
.tab-btn {
    flex: 1;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    font-size: 15px;
    color: #666;
    background: #fafafa;
    border: none;
    transition: all 0.3s;
}
.tab-btn.active {
    background: #fff;
    color: #667eea;
    font-weight: bold;
    border-bottom: 2px solid #667eea;
}
.tab-content {
    display: none;
    padding: 15px;
}
.tab-content.active { display: block; }
.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.result-count {
    font-size: 13px;
    color: #666;
}
.result-count span {
    color: #667eea;
    font-weight: bold;
}
.university-card, .major-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    padding: 18px 20px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s;
    border-left: 4px solid #667eea;
    cursor: pointer;
}
.university-card:hover, .major-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.card-left {
    flex-shrink: 0;
}
.card-center {
    flex: 1;
    min-width: 0;
}
.card-right {
    flex-shrink: 0;
}
.university-name {
    margin: 0 0 6px 0;
    font-size: 16px;
    font-weight: bold;
    color: #333;
}
.logo {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    background: #f5f5f5;
    flex-shrink: 0;
}
.tags {
    margin: 4px 0;
    font-size: 11px;
}
.tags .tag {
    display: inline-block;
    background: #f0f5ff;
    color: #667eea;
    padding: 1px 5px;
    border-radius: 3px;
    margin-right: 3px;
}
.location {
    color: #999;
    font-size: 12px;
}
.stat-row {
    display: flex;
    gap: 25px;
}
.stat-row .stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 15px;
    background: #f8f9fa;
    border-radius: 6px;
    min-width: 80px;
}
.stat-row .stat-item .label {
    font-size: 12px;
    color: #999;
    margin-bottom: 4px;
}
.stat-row .stat-item .value {
    font-size: 18px;
    font-weight: bold;
    color: #667eea;
}
.major-name {
    font-size: 14px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}
.major-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 12px;
    color: #666;
}
.pagination {
    text-align: center;
    padding: 15px;
}
.pagination button {
    padding: 6px 15px;
    margin: 0 3px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}
.pagination button:hover:not(:disabled) {
    border-color: #667eea;
    color: #667eea;
}
.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.pagination .page-info {
    margin: 0 10px;
    color: #666;
    font-size: 13px;
}
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: none;
    overflow-y: auto;
    padding: 20px;
}
.modal-overlay.show { display: flex; justify-content: center; align-items: flex-start; }
.modal-content {
    background: #fff;
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    margin: 20px 0;
    display: flex;
    flex-direction: column;
}
.modal-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}
.modal-scroll::-webkit-scrollbar {
    width: 8px;
}
.modal-scroll::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}
.modal-scroll::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}
.modal-scroll::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}
.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    color: #666;
    z-index: 10;
}
.modal-close:hover { background: #e8e8e8; }
.detail-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px;
    color: #fff;
    display: flex;
    gap: 20px;
    align-items: flex-start;
}
.detail-logo {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    background: #fff;
    object-fit: cover;
}
.detail-info h2 {
    margin: 0 0 10px 0;
    font-size: 22px;
}
.detail-info .tags { margin-bottom: 8px; }
.detail-info .tags .tag {
    background: rgba(255,255,255,0.2);
    color: #fff;
}
.detail-info .meta {
    font-size: 14px;
    opacity: 0.9;
}
.detail-body {
    padding: 20px;
}
.detail-section {
    margin-bottom: 25px;
}
.detail-section h3 {
    font-size: 16px;
    color: #333;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
    display: inline-block;
}
.year-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}
.year-tab {
    padding: 6px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.year-tab.active {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}
.stat-card {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}
.stat-card .value {
    font-size: 20px;
    font-weight: bold;
    color: #667eea;
}
.stat-card .label {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}
.major-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: fixed;
}
.major-table th, .major-table td {
    padding: 10px 8px;
    text-align: center;
    border-bottom: 1px solid #eee;
}
.major-table th:first-child, .major-table td:first-child {
    text-align: left;
}
.major-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #666;
    position: sticky;
    top: 0;
}
.major-table th:nth-child(1), .major-table td:nth-child(1) { width: 40%; }
.major-table th:nth-child(2), .major-table td:nth-child(2) { width: 10%; }
.major-table th:nth-child(3), .major-table td:nth-child(3) { width: 10%; }
.major-table th:nth-child(4), .major-table td:nth-child(4) { width: 10%; }
.major-table th:nth-child(5), .major-table td:nth-child(5) { width: 10%; }
.major-table th:nth-child(6), .major-table td:nth-child(6) { width: 10%; }
.major-table tr:hover td { background: #f9f9f9; }
.major-table .zy-name {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.zyz-section {
    margin-top: 20px;
}
.zyz-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
}
.zyz-item h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #333;
}
.zyz-item .zyz-majors {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.zyz-item .zyz-major {
    background: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    border: 1px solid #ddd;
}
.zyz-block {
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
}
.zyz-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.zyz-header .zyz-name {
    font-weight: bold;
    font-size: 14px;
}
.zyz-header .zyz-stats {
    display: flex;
    gap: 15px;
}
.zyz-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 55px;
}
.zyz-stat-item label {
    font-size: 11px;
    opacity: 0.8;
}
.zyz-stat-item value {
    font-size: 14px;
    font-weight: bold;
}
.zyz-block .major-table {
    margin: 0;
}
.empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
}
@media (max-width: 768px) {
    .search-row { flex-direction: column; }
    .form-group { width: 100%; }
    .keyword-wrapper { min-width: 100%; }
    .university-card { flex-direction: column; align-items: flex-start; }
    .card-left { margin-bottom: 10px; }
    .card-center { width: 100%; }
    .card-right { width: 100%; }
    .stat-row { flex-wrap: wrap; gap: 10px; }
    .stat-row .stat-item { flex: 1; min-width: 70px; padding: 6px 10px; }
    .stat-row .stat-item .value { font-size: 16px; }
    .detail-header { flex-direction: column; align-items: center; text-align: center; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
