/* ===== 全域基礎設定 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Kiwi Maru", "Microsoft JhengHei", sans-serif;
    background: linear-gradient(145deg, #fae3f0 0%, #d9e4f5 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #2d1b3c;
    line-height: 1.6;
}

/* ===== 頁首區域 ===== */
header {
    padding: 48px 24px 32px;
    max-width: 800px;
    width: 100%;
    text-align: center;
}

h1 {
    font-size: clamp(1.8rem, 6vw, 2.8rem);
    font-weight: 400;
    letter-spacing: 5px;
    background: linear-gradient(135deg, #6a1b9a, #3c1e5f);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
    text-shadow: 0 2px 10px rgba(106, 27, 154, 0.15);
}

header p {
    font-size: 1.2rem;
    color: #4a2c5f;
    opacity: 0.9;
    font-weight: 400;
}

/* ===== 搜尋框樣式 ===== */
.search-container {
    max-width: 500px;
    margin: 30px auto 10px;
    padding: 0 20px;
}

.search-input {
    width: 100%;
    padding: 15px 25px;
    font-size: 1.1rem;
    border: none;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 15px rgba(106, 27, 154, 0.15);
    font-family: "Kiwi Maru", "Microsoft JhengHei", sans-serif;
    transition: all 0.3s ease;
    outline: none;
    border: 2px solid transparent;
}

.search-input:focus {
    background: white;
    box-shadow: 0 8px 25px rgba(106, 27, 154, 0.25);
    border-color: #8e44ad;
}

.search-input::placeholder {
    color: #aaa;
    font-weight: 300;
}

/* 搜尋結果提示 */
.search-info {
    text-align: center;
    color: #6a4e7c;
    margin: 10px 0 20px;
    font-size: 0.95rem;
    min-height: 24px;
}

/* 沒有結果時的提示 */
.no-result {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 30px;
    color: #6a4e7c;
    font-size: 1.2rem;
    backdrop-filter: blur(4px);
}

/* ===== 學校卡片網格 ===== */
.school-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    padding: 24px;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

/* 卡片本體 */
.school-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 28px 20px 24px;
    border-radius: 32px;
    box-shadow: 
        0 15px 35px -10px rgba(90, 40, 120, 0.25),
        0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.35s cubic-bezier(0.2, 0, 0, 1);
    border: 1px solid rgba(255, 255, 255, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.school-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 
        0 25px 40px -15px rgba(110, 40, 150, 0.4),
        0 4px 12px rgba(0, 0, 0, 0.1);
    background: white;
}

.school-card h2 {
    font-size: 1.6rem;
    font-weight: 400;
    margin-bottom: 16px;
    color: #3a1b4f;
    letter-spacing: 1px;
    border-bottom: 2px dashed #c9b0dc;
    padding-bottom: 10px;
    width: 100%;
}

/* 加入按鈕 */
.join-btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 60px;
    background: linear-gradient(145deg, #8e44ad, #6c3483);
    color: white;
    font-weight: 450;
    font-size: 1.1rem;
    text-decoration: none;
    box-shadow: 0 8px 18px -6px #7d3c98;
    transition: all 0.25s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
    margin-top: 8px;
    width: fit-content;
}

.join-btn:hover {
    background: linear-gradient(145deg, #9b59b6, #7d3c98);
    box-shadow: 0 10px 22px -4px #8e44ad;
    transform: scale(1.05);
    color: white;
    text-decoration: none;
}

/* ===== 頁尾區域 ===== */
footer {
    margin-top: 60px;
    padding: 40px 24px 30px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    width: 100%;
    border-top: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 -5px 20px rgba(130, 70, 170, 0.08);
}

footer h3 {
    font-size: 1.8rem;
    color: #4a2c5f;
    margin-bottom: 24px;
    font-weight: 300;
    letter-spacing: 1px;
    text-align: center;
}

/* 社群連結區塊 */
.social-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px 24px;
    max-width: 800px;
    margin: 0 auto 20px;
}

.social-links a {
    text-decoration: none;
    color: #5e3a7c;
    font-weight: 500;
    font-size: 1.1rem;
    padding: 8px 18px;
    border-radius: 40px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(2px);
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.social-links a:hover {
    background: white;
    color: #6b2d91;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -6px #a17ab3;
    border-color: #b39ddb;
}

/* 版權文字 */
.copyright {
    font-size: 0.9rem;
    color: #6a4e7c;
    opacity: 0.7;
    letter-spacing: 0.5px;
    margin-top: 16px;
    border-top: 1px solid rgba(160, 120, 200, 0.2);
    padding-top: 16px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

/* ===== 響應式微調 ===== */
@media (max-width: 600px) {
    header {
        padding: 36px 16px 24px;
    }

    .school-container {
        gap: 16px;
        padding: 16px;
    }

    .school-card {
        padding: 22px 16px;
    }

    .school-card h2 {
        font-size: 1.4rem;
    }

    .join-btn {
        padding: 10px 24px;
        font-size: 1rem;
    }

    footer h3 {
        font-size: 1.5rem;
    }

    .social-links a {
        padding: 6px 14px;
        font-size: 1rem;
    }
    
    .search-input {
        padding: 12px 20px;
        font-size: 1rem;
    }
}

/* 超小螢幕 */
@media (max-width: 380px) {
    .social-links {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .social-links a {
        width: 80%;
        text-align: center;
    }
}