/* style.css */
:root {
    --primary-purple: #7a0085;
    --secondary-orange: #cc12dd;
    --card-shadow: 0 2px 8px rgba(122, 0, 133, 0.1);
    --public-green: #4caf50;
    --private-red: #ff5252;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: #ffffff;
    margin: 0;
    padding: 20px;
    transition: background 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 2;  
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0px 0;
}

.header-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.header {
    color: var(--primary-purple);
    font-size: 1.4em;
}

.search-container {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 70%;
    margin: 0 auto 30px;
    position: relative;
}

/* 搜索框和按钮样式 */
.autocomplete {
    position: relative;
    display: flex;
    flex: 1;
}

#searchInput {
    flex: 1;
    padding: 10px;
    padding-right: 140px;
    border: 2px solid var(--primary-purple);
    border-radius: 30px;
    font-size: 16px;
    outline: none;
    transition: box-shadow 0.3s;
    width: 100%;
    box-sizing: border-box;
    overflow: visible;
    white-space: nowrap;
}

#searchInput:focus {
    box-shadow: 0 0 8px rgba(122, 0, 133, 0.2);
}

.search-button {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 125px;
    background-color: #7a0085;
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: -2px 0 4px rgba(0,0,0,0.1);
    padding: 0;
}

.search-button:hover {
    background-color: #5a0063;
}

.profession-card button {
    background: linear-gradient(135deg, #ff6b35, #ff9f1c);
    white-space: nowrap;
    min-width: 120px;
    margin-left: auto;
    padding: 10px 35px;
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: opacity 0.3s;
}

.suggestions-box {
    position: absolute;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    background: white;
    border: 2px solid var(--primary-purple);
    border-radius: 15px 15px 15px 15px;
    box-shadow: var(--card-shadow);
    margin-top: 0;
    top: 100%;
    z-index: 1000;
    display: none;
}

.suggestion-item {
    padding: 10px 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
}

.suggestion-item:hover {
    background: #f7f9f5;
}

.suggestion-code {
    color: var(--secondary-orange);
    font-size: 0.9em;
}

.result-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 0 0px;
}

.profession-card {
    background: white;
    padding: 15px;
    border-radius: 15px;
    box-shadow: var(--card-shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.profession-info {
    flex: 1;
    min-width: 0;
}

.profession-info h2 {
    margin: 15px 0 0 0;
    font-size: 1.0em;
    word-break: break-word;
}

.school-card {
    background: white;
    padding: 12px 15px;
    margin: 10px 0;
    border-radius: 15px;
    box-shadow: var(--card-shadow);
    min-height: 110px;
    position: relative;
}

.school-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    gap: 10px;
}

.school-logo {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: contain;
    border: 1px solid #eee;
}

.school-header h4 {
    margin: 0 10px 0 0;
    font-size: 1.1em;
}

.school-type {
    display: inline-block !important;
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: 600;
    color: white !important;
    margin-left: 12px;
}

.school-type.public {
    background: var(--public-green) !important;
}

.school-type.private {
    background: var(--private-red) !important;
}

.admission-table {
    width: 100%;
    margin-top: 8px;
    border-collapse: collapse;
}

.admission-table th,
.admission-table td {
    padding: 6px 8px;
    text-align: center;
    border-bottom: 1px solid #eee;
    font-size: 0.9em;
    line-height: 1.3;
}

.admission-table th {
    background: var(--primary-purple);
    color: white;
}

.error-message {
    color: #dc3545;
    text-align: center;
    padding: 15px;
    animation: fadeOut 3s forwards;
}

@keyframes fadeOut {
    0% { opacity: 1; }
    90% { opacity: 1; }
    100% { opacity: 0; }
}

.back-button {
    margin-bottom: 12px;
    padding: 8px 15px;
    background: #666;
    color: white;
    border-radius: 20px;
}

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

.loading {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(122, 0, 133, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-purple);
    animation: spin 1s ease-in-out infinite;
    margin: 20px auto;
}

/* 移除不必要的背景图片引用，避免404错误 */
/* body::after {
    content: "";
    background: url('images/mobile-bg.webp') no-repeat -9999px -9999px;
    background: url('images/mobile-bg@2x.webp') no-repeat -9999px -9999px;
    background: url('images/mobile-bg-dark.webp') no-repeat -9999px -9999px;
}
 */
/* 倒计时模块样式 */
.countdown-container {
    margin: 25px auto;
    padding: 25px 30px;
    background: rgba(255, 255, 255, 0.97);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(122, 0, 133, 0.1);
    max-width: 680px;
    transition: transform 0.2s ease;
}

.countdown-header {
    text-align: center;
    font-size: 1.5em;
    color: #5a5a5a;
    margin-bottom: 18px;
    letter-spacing: 0.8px;
    font-weight: 500;
}

.countdown-box {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.time-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 75px;
}

.time-number {
    font-size: 2.6em;
    font-weight: 700;
    color: #7a0085;
    line-height: 1.1;
    font-family: 'Arial', sans-serif;
    text-shadow: 0 2px 4px rgba(122,0,133,0.1);
}

.time-label {
    font-size: 1em;
    color: #666;
    margin-top: 8px;
}

.colon {
    font-size: 2.4em;
    color: #7a0085;
    transform: translateY(-8px);
    opacity: 0.8;
}

.exam-title {
    text-align: center;
    font-size: 1.1em;
    color: #7a0085;
    margin-top: 15px;
    opacity: 0.9;
}

.notice-text {
    font-size: 0.92em;
    color: #666;
    line-height: 1.6;
    opacity: 0.75;
    margin: 18px 30px 0;
    padding: 12px 20px;
    text-align: justify;
    text-justify: inter-ideograph;
    background: rgba(255,255,255,0.3);
    border-radius: 8px;
}

/* 兑换码弹窗样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: rgba(255,255,255,0.95);
    margin: 15% auto;
    padding: 25px;
    border-radius: 12px;
    width: 80%;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.modal-content h3 {
    color: #7a0085;
    text-align: center;
    margin-bottom: 20px;
}

#redeemCodeInput {
    width: 92%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
}

#verifyRedeemCode {
    width: 100%;
    padding: 12px;
    background-color: #7a0085;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
}

#verifyRedeemCode:hover {
    background-color: #5a0063;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #7a0085;
}

#redeemError {
    color: #ff3333;
    margin-top: 10px;
    text-align: center;
    font-size: 14px;
}

.qr-code-container {
    text-align: center;
    margin: 15px 0;
}

.qr-code {
    max-width: 200px;
    height: auto;
    border: 1px solid #eee;
    border-radius: 8px;
}

/* 图表弹窗样式 */
.chart-container {
    max-width: 800px;
    padding: 30px 30px 50px;
    width: 90%;
    position: relative;
}

.chart-slider {
    display: flex;
    overflow: hidden;
    position: relative;
}

.chart-slide {
    min-width: 100%;
    transition: transform 0.3s ease;
    padding: 0 10px;
}

.chart-slide h3 {
    text-align: center;
    color: var(--primary-purple);
    margin-bottom: 20px;
}

/* 响应端箭头按钮 */
.chart-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 80px;
    background: rgba(122, 0, 133, 0.8);
    color: white;
    border: none;
    font-size: 1.5em;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    border-radius: 0;
}

.chart-prev-arrow {
    left: -40px;
    border-radius: 8px 0 0 8px;
}

.chart-next-arrow {
    right: -40px;
    border-radius: 0 8px 8px 0;
}

.chart-arrow:hover {
    background: rgba(122, 0, 133, 1);
}

/* 图表切换按钮样式 */
.chart-toggle {
    position: relative;
    margin: 20px auto 0;
    display: flex;
    background-color: rgba(122, 0, 133, 0.1);
    border-radius: 30px;
    padding: 6px;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-width: 200px;
    width: 90%;
    text-align: center;
    overflow: hidden;
}

.toggle-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    background-color: transparent;
    color: #7a0085;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    white-space: nowrap;
    flex: 1;
    text-align: center;
    min-width: 80px;
    position: relative;
    z-index: 2;
}

.toggle-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.chart-toggle::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 6px;
    width: calc(50% - 6px);
    height: calc(100% - 12px);
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 25px;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.chart-toggle.toggled::before {
    transform: translateX(100%);
}

.toggle-btn.active {
    color: #7a0085;
    font-weight: 600;
    z-index: 2;
}

/* 移动端样式调整 */
@media (max-width: 768px) {
    .chart-arrow {
        display: none;
    }
    
    .countdown-box {
        gap: 5px;
    }
    
    .time-section {
        min-width: 35px;
    }
    
    .time-number {
        font-size: 1.2em;
    }
    
    .time-label {
        font-size: 0.7em;
    }
    
    .colon {
        font-size: 1.2em;
        transform: translateY(-3px);
    }
    
    .countdown-header {
        font-size: 1em;
    }
    
    .exam-title {
        font-size: 0.8em;
    }
}

/* 图表样式 */
canvas {
    width: 100% !important;
    height: 300px !important;
}

/* 触摸事件样式 */
.countdown-container {
    transition: transform 0.2s ease;
}

.countdown-container:active {
    transform: scale(0.98);
    opacity: 0.95;
}

.notice-text:active {
    background-color: rgba(255,255,255,0.4);
}

/* 悬浮按钮样式 */
.floating-button {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 999;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.floating-button.show {
    opacity: 1;
    visibility: visible;
}

.floating-button:hover {
    transform: translateY(-50%) scale(1.1);
}

.floating-button svg {
    transition: all 0.3s ease;
}

.floating-button:hover svg {
    transform: scale(1.05);
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* 响应式设计 - 移动设备 */
@media (max-width: 768px) {
    .floating-button {
        right: 15px;
        top: 80%;
    }
    
    .floating-button svg {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .floating-button {
        right: 10px;
    }
    
    .floating-button svg {
        width: 35px;
        height: 35px;
    }
}
