:root {
    --primary-color: #00bcd4;
    --primary-dark: #0097a7;
    --accent-color: #ff9800;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-main: #333333;
    --text-muted: #666666;
    --border-color: #e0e0e0;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --glass-bg: rgba(255, 255, 255, 0.8);
    --transition: all 0.3s ease;

    /* Category Colors */
    --yellow-theme: #fbc02d;
    --green-theme: #4caf50;
    --blue-theme: #2196f3;
    --dark-blue-theme: #3f51b5;
    --purple-theme: #9c27b0;
    --orange-theme: #ef6c00;
    --magenta-theme: #c2185b;
    --brown-theme: #795548;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Noto Sans TC', sans-serif;
    background-color: #f0f2f5;
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

.mobile-container {
    width: 100%;
    max-width: 480px;
    /* Max width for mobile experience */
    margin: 0 auto;
    background-color: var(--bg-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- SIDE MENU --- */
.menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.menu-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.menu-drawer {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background: #fff;
    z-index: 2001;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.menu-drawer.active {
    transform: translateX(280px);
}

.menu-header {
    padding: 20px;
    background: var(--primary-color);
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.menu-nav {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.menu-item {
    display: block;
    padding: 14px 24px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 15px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.menu-item:active {
    background: #f5f5f5;
}

/* --- HEADER --- */
.header {
    background-color: #fff;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    height: 56px;
}

.menu-icon {
    font-size: 20px;
    color: var(--text-main);
}

.site-title {
    font-size: 18px;
    font-weight: 700;
    color: #444;
}

.header-icons {
    display: flex;
    gap: 16px;
    font-size: 18px;
    color: var(--text-muted);
}

.notice-bar {
    background-color: #fffde7;
    color: #f57f17;
    padding: 8px 16px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #fff9c4;
}

.notice-content {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hero-section {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
    color: #fff;
}

.hero-overlay h2 {
    font-size: 22px;
    margin-bottom: 4px;
}

.hero-overlay p {
    font-size: 14px;
    opacity: 0.9;
}

/* --- MAIN CONTENT --- */
.content {
    padding: 16px;
    flex: 1;
}

/* Calendar Section */
.calendar-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.filter-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 16px;
    font-size: 14px;
}

.filter-controls select {
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: #fff;
}

.warning-icon {
    color: var(--accent-color);
    margin-left: auto;
}

.calendar-grid-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.calendar-table {
    width: 100%;
    border-collapse: collapse;
}

.cal-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background-color: #f5f5f5;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    padding: 10px 0;
    border-radius: 8px 8px 0 0;
    color: var(--text-muted);
}

.cal-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 13px;
    border: 1px solid #f0f0f0;
    border-top: none;
    border-radius: 0 0 8px 8px;
}

.cal-day {
    padding: 12px 0;
    border-right: 1px solid #f9f9f9;
    border-bottom: 1px solid #f9f9f9;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50px;
}

.cal-day:nth-child(7n) {
    border-right: none;
}

.cal-day.today {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #fff;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0, 188, 212, 0.3);
}

.calendar-info {
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
    font-size: 13px;
}

.info-row {
    display: flex;
    margin-bottom: 4px;
}

.info-label {
    min-width: 60px;
    color: var(--text-muted);
}

/* Quick Access Grid */
.quick-access {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.access-item {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
}

.access-item:active {
    transform: scale(0.95);
}

.access-title {
    padding: 6px;
    color: #fff;
    font-weight: 500;
    font-size: 14px;
}

.access-title.yellow {
    background-color: var(--yellow-theme);
}

.access-title.green {
    background-color: var(--green-theme);
}

.access-title.blue {
    background-color: var(--blue-theme);
}

.access-img {
    height: 100px;
    background-color: #eee;
}

.access-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Article List */
.article-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.article-item {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.section-badge {
    padding: 6px 16px;
    color: #fff;
    font-weight: 500;
    font-size: 14px;
    text-align: center;
}

.section-badge.dark-blue {
    background-color: var(--dark-blue-theme);
}

.section-badge.purple {
    background-color: var(--purple-theme);
}

.section-badge.orange {
    background-color: var(--orange-theme);
}

.section-badge.magenta {
    background-color: var(--magenta-theme);
}

.section-badge.brown {
    background-color: var(--brown-theme);
}

.article-layout {
    display: flex;
    padding: 12px;
    gap: 12px;
    align-items: center;
}

.article-img {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.article-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-text {
    font-size: 13px;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.more-sections {
    text-align: center;
    padding: 10px 0;
}

.more-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
}

/* --- FOOTER --- */
.footer {
    background-color: #424242;
    color: #fff;
    padding: 32px 20px;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.footer-col h4 {
    font-size: 14px;
    margin-bottom: 12px;
    color: #bdbdbd;
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: 8px;
}

.footer-col a {
    color: #e0e0e0;
    text-decoration: none;
    font-size: 12px;
}

.footer-bottom {
    border-top: 1px solid #616161;
    padding-top: 20px;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 24px;
    margin-bottom: 16px;
    color: #e0e0e0;
}

.copyright {
    text-align: center;
    font-size: 10px;
    color: #9e9e9e;
}

.copyright p {
    margin-bottom: 4px;
}