/* ==========================================================================
   校園規範獨立按鈕頁面 - 樣式表 (藍色同色系深淺變化 + 斜切星號切帶)
   ========================================================================== */

/* 1. CSS 變數定義 (設計系統) */
:root {
    --primary-blue: #0b579d;
    --header-title-color: #0c4a6e;
    --bg-page: #edf4fe;
    --card-bg: #ffffff;
    --card-border-radius: 20px;
    --card-shadow: 0 12px 36px rgba(11, 87, 157, 0.12);
    
    /* 卡片標題漸層 */
    --card-header-bg: linear-gradient(90deg, #0077e6 0%, #0096c7 45%, #00b4d8 70%, #00a896 100%);
    
    /* 藍色同色系深淺按鈕 (依據圖示一深淺交替) */
    /* 淺藍按鈕 */
    --btn-light-bg: linear-gradient(135deg, #8ebbff 0%, #7db0fd 100%);
    --btn-light-badge: linear-gradient(135deg, #71a1f7 0%, #5d92f3 100%);
    --btn-light-shadow: 0 6px 16px rgba(125, 176, 253, 0.38);
    --btn-light-hover-shadow: 0 10px 22px rgba(125, 176, 253, 0.55);

    /* 深藍/紫藍按鈕 */
    --btn-dark-bg: linear-gradient(135deg, #6688f7 0%, #5579f3 100%);
    --btn-dark-badge: linear-gradient(135deg, #4b6ee7 0%, #3a5edb 100%);
    --btn-dark-shadow: 0 6px 16px rgba(102, 136, 247, 0.38);
    --btn-dark-hover-shadow: 0 10px 22px rgba(102, 136, 247, 0.55);

    --text-white: #ffffff;
    --font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* 2. 基本重置與頁面底色 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-page);
    background-image: radial-gradient(#cbdcf7 1.5px, transparent 1.5px);
    background-size: 24px 24px;
    color: #333333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 3. 頁首橫幅區塊 (Header) */
.school-header {
    background-color: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    position: relative;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* 左側學校 Logo 與校名 */
.school-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-circle {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #0072ff, #00c6ff);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 900;
    box-shadow: 0 4px 10px rgba(0, 114, 255, 0.3);
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.school-name-zh {
    font-size: 1rem;
    font-weight: 700;
    color: #0b579d;
    line-height: 1.2;
}

.school-name-en {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
}

/* 中間大標題 */
.portal-title {
    font-size: 1.75rem;
    font-weight: 900;
    color: var(--header-title-color);
    letter-spacing: 2px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* 右側星星裝飾 */
.header-stars {
    display: flex;
    align-items: flex-start;
    gap: 4px;
}

.star {
    font-size: 1.5rem;
}

.star-orange {
    color: #fbbf24;
    transform: rotate(-10deg);
}

.star-blue {
    color: #38bdf8;
    font-size: 1.2rem;
    transform: rotate(15deg);
}

/* 頂部斜線裝飾條 */
.stripe-bar {
    height: 12px;
    background: repeating-linear-gradient(
        -45deg,
        #6ee7b7,
        #6ee7b7 12px,
        #34d399 12px,
        #34d399 24px
    );
    width: 100%;
}

/* 4. 主要內容容器 */
.main-container {
    flex: 1;
    max-width: 1100px;
    width: 100%;
    margin: 40px auto;
    padding: 0 20px;
}

/* 卡片容器 */
.card-section {
    background-color: var(--card-bg);
    border-radius: var(--card-border-radius);
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(226, 232, 240, 0.8);
    overflow: hidden;
}

/* 卡片頂部 Header Bar */
.card-header {
    background: var(--card-header-bg);
    padding: 16px 28px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.header-icon-wrap {
    width: 42px;
    height: 42px;
    background-color: #ffc83b;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1e293b;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.card-title {
    color: #ffffff;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* 5. 卡片內容與按鈕網格 (Button Grid) */
.card-body {
    padding: 36px 32px 44px 32px;
}

.button-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px 20px;
}

/* 獨立按鈕樣式 (同色系深淺變化 + 斜條星星角飾) */
.rule-btn {
    display: flex;
    align-items: center;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-white);
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.6);
    outline: none;
    user-select: none;
    min-height: 56px;
}

/* 淺藍款按鈕 */
.rule-btn.btn-blue-light {
    background: var(--btn-light-bg);
    box-shadow: var(--btn-light-shadow);
}

.rule-btn.btn-blue-light:hover {
    box-shadow: var(--btn-light-hover-shadow);
    transform: translateY(-3px) scale(1.015);
}

/* 深藍款按鈕 */
.rule-btn.btn-blue-dark {
    background: var(--btn-dark-bg);
    box-shadow: var(--btn-dark-shadow);
}

.rule-btn.btn-blue-dark:hover {
    box-shadow: var(--btn-dark-hover-shadow);
    transform: translateY(-3px) scale(1.015);
}

/* 左側斜切打頭帶 (Diagonal Badge) */
.btn-star-badge {
    width: 48px;
    height: 100%;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    clip-path: polygon(0 0, 100% 0, 68% 100%, 0 100%);
    flex-shrink: 0;
    padding-right: 8px;
    transition: background 0.2s ease;
}

.btn-blue-light .btn-star-badge {
    background: var(--btn-light-badge);
}

.btn-blue-dark .btn-star-badge {
    background: var(--btn-dark-badge);
}

/* 星星圖示 */
.btn-icon-star {
    font-size: 1.3rem;
    color: #ffffff;
    filter: drop-shadow(1px 2px 3px rgba(0, 0, 0, 0.25));
    transform: translateX(-2px);
}

/* 按鈕文字 */
.btn-label {
    flex: 1;
    padding: 12px 14px 12px 4px;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.4;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.25);
    letter-spacing: 0.3px;
    word-break: break-word;
    text-align: center;
}

/* 按鈕按下與焦點效果 */
.rule-btn:active {
    transform: translateY(-1px) scale(0.99);
}

.rule-btn:focus-visible {
    outline: 3px solid #38bdf8;
    outline-offset: 3px;
}

/* 6. 頁尾 */
.site-footer {
    text-align: center;
    padding: 24px;
    color: #64748b;
    font-size: 0.9rem;
    border-top: 1px solid rgba(203, 213, 225, 0.4);
    background-color: rgba(255, 255, 255, 0.6);
}

/* 7. Toast 提示懸浮窗 */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: #1e293b;
    color: #ffffff;
    padding: 14px 24px;
    border-radius: 50px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 9999;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    visibility: visible;
}

.toast-icon {
    font-size: 1.2rem;
}

.toast-text {
    font-size: 0.95rem;
    font-weight: 500;
}

/* 8. 響應式設計 (RWD) */
@media (max-width: 960px) {
    .button-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
    }

    .portal-title {
        font-size: 1.4rem;
    }
}

@media (max-width: 640px) {
    .header-container {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .header-stars {
        display: none;
    }

    .card-body {
        padding: 24px 18px;
    }

    .button-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .rule-btn {
        font-size: 1rem;
        min-height: 50px;
    }
}
