<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Bangumi Calendar</title>
    <style>
        :root {
            --bg-color: #f7f8fa;
            --card-bg: #ffffff;
            --primary-color: #FB8C00;
            --secondary-color: #FFF3E0;
            --text-main: #1a1a1a;
            --text-sub: #8590a6;
            --text-light: #999;
            --border-color: #eaeaea;
            --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
            --shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
        }

        body {
            margin: 0;
            padding: 30px;
            font-family: var(--font-family);
            background-color: #f0f2f5;
            display: flex;
            justify-content: center;
            min-height: 100vh;
            box-sizing: border-box;
        }

        .container {
            width: 1400px;
            display: flex;
            flex-direction: column;
            gap: 20px;
        }

        .calendar-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 10px;
        }

        .calendar-title {
            font-size: 32px;
            font-weight: 800;
            color: var(--text-main);
            margin: 0;
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .calendar-title::before {
            content: "";
            width: 8px;
            height: 32px;
            background-color: var(--primary-color);
            border-radius: 4px;
        }

        .calendar-grid {
            display: grid;
            grid-template-columns: repeat(7, 1fr);
            gap: 16px;
            align-items: start;
        }

        .day-column {
            background-color: rgba(255, 255, 255, 0.7);
            border-radius: 16px;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            min-height: 600px;
            border: 1px solid rgba(0, 0, 0, 0.03);
            backdrop-filter: blur(10px);
        }

        .day-column.today {
            background-color: var(--card-bg);
            box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
            border: 2px solid var(--primary-color);
            transform: scale(1.02);
            z-index: 10;
        }

        .day-header {
            padding: 16px;
            text-align: center;
            border-bottom: 1px solid var(--border-color);
        }

        .today .day-header {
            background-color: var(--primary-color);
            color: white;
            border-bottom: none;
        }

        .day-name-cn {
            font-size: 18px;
            font-weight: 800;
            display: block;
        }

        .day-name-en {
            font-size: 12px;
            opacity: 0.7;
            text-transform: uppercase;
            letter-spacing: 1px;
            margin-top: 2px;
            display: block;
        }

        .items-list {
            display: flex;
            flex-direction: column;
            gap: 1px;
            background-color: var(--border-color);
        }

        .anime-item {
            background-color: white;
            padding: 12px;
            display: flex;
            flex-direction: column;
            gap: 8px;
            transition: background-color 0.2s;
            position: relative;
        }

        .anime-item:hover {
            background-color: #fafafa;
        }

        .anime-cover-wrapper {
            width: 100%;
            aspect-ratio: 2/3;
            border-radius: 8px;
            overflow: hidden;
            box-shadow: var(--shadow);
            background-color: #f0f0f0;
        }

        .anime-cover {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .anime-info {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        .anime-title {
            font-size: 14px;
            font-weight: 700;
            color: var(--text-main);
            line-height: 1.4;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
            text-overflow: ellipsis;
            min-height: 2.8em;
        }

        .anime-meta {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: 2px;
        }

        .anime-score {
            font-size: 12px;
            font-weight: 800;
            color: var(--primary-color);
            display: flex;
            align-items: center;
            gap: 2px;
        }

        .anime-rank {
            font-size: 11px;
            color: var(--text-light);
            background: #f5f5f5;
            padding: 1px 6px;
            border-radius: 4px;
        }

        .today-badge {
            position: absolute;
            top: 8px;
            right: 8px;
            background-color: var(--primary-color);
            color: white;
            font-size: 10px;
            font-weight: 800;
            padding: 2px 6px;
            border-radius: 4px;
            box-shadow: 0 2px 8px rgba(251, 140, 0, 0.4);
            z-index: 2;
        }

        .empty-day {
            padding: 40px 20px;
            text-align: center;
            color: var(--text-light);
            font-size: 14px;
            font-style: italic;
        }
    </style>
</head>
<body>
<div class="container">
    <header class="calendar-header">
        <h1 class="calendar-title">每日放送表 <span style="font-size: 16px; color: var(--text-sub); font-weight: 500;">Bangumi Calendar</span>
        </h1>
    </header>

    <div class="calendar-grid">
        {% for day in days %}
            <div class="day-column {{ 'today' if day.is_today else '' }}">
                <div class="day-header">
                    <span class="day-name-cn">{{ day.weekday.cn }}</span>
                    <span class="day-name-en">{{ day.weekday.en }}</span>
                </div>
                <div class="items-list">
                    {% for item in day['items'] %}
                        <div class="anime-item">
                            <div class="anime-cover-wrapper">
                                <img class="anime-cover"
                                     src="{{ item.images.common or item.images.large or item.images.medium }}"
                                     alt="{{ item.name_cn or item.name }}"
                                     referrerpolicy="no-referrer">
                            </div>
                            <div class="anime-info">
                                <div class="anime-title">{{ item.name_cn or item.name }}</div>
                                <div class="anime-meta">
                                    {% if item.rating and item.rating.score %}
                                        <div class="anime-score">
                                            <span>★</span>
                                            <span>{{ item.rating.score }}</span>
                                        </div>
                                    {% endif %}
                                    {% if item.rank %}
                                        <div class="anime-rank">#{{ item.rank }}</div>
                                    {% endif %}
                                </div>
                            </div>
                        </div>
                    {% else %}
                        <div class="empty-day">今日无更新内容</div>
                    {% endfor %}
                </div>
            </div>
        {% endfor %}
    </div>
</div>
</body>
</html>