@charset "utf-8";
/* CSS Document */

        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        body, html {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
            background-color: #f8f9fa;
            color: #333;
            line-height: 1.6;
            overflow-x: hidden; /* 防止横向滚动 */
        }

        /* 固定头部 - 使用 fixed 定位 */
        header {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            background-color: #fff;
            padding: 10px 20px;
            border-bottom: 1px solid #e0e0e0;
            z-index: 1000;
            box-shadow: 0 2px 4px rgba(0,0,0,0.05);
            display: flex;
            justify-content: center;
            align-items: center;
            flex-wrap: wrap;
            gap: 16px;
        }

        .header-title h2 {
            font-weight: bold;
            font-size: 22px;
            white-space: nowrap;
            color: red;
            margin: 0;
        }

        .search-box {
            display: flex;
            max-width: 400px;
            width: 100%;
        }

        .search-box input[type="text"] {
            flex: 1;
            padding: 8px 10px;
            border: 1px solid #ccc;
            border-radius: 4px 0 0 4px;
            font-size: 14px;
            min-width: 0;
        }

        .search-box input[type="submit"] {
            padding: 8px 16px;
            background-color: #007bff;
            color: white;
            border: none;
            border-left: none;
            border-radius: 0 4px 4px 0;
            cursor: pointer;
            font-size: 14px;
        }

        .search-box input[type="submit"]:hover {
            background-color: #0069d9;
        }

        .header-nav ul {
            list-style: none;
            display: flex;
            gap: 16px;
            margin: 0;
            padding: 0;
        }

        .header-nav a {
            text-decoration: none;
            color: #212529;
            font-weight: 500;
            padding: 6px 10px;
            border-radius: 4px;
            transition: background 0.2s;
        }

        .header-nav a:hover {
            background-color: #ced4da;
        }

        /* 主体容器：两栏布局 */
        .container {
            max-width: 66%;
            margin: 0 auto;
            padding: 0 15px;
            display: grid;
            grid-template-columns: 1fr 30%;
            gap: 20px;
            /* 为固定头部留出空间 */
            margin-top: 90px; /* PC 端估算高度 */
    /* 额外增加上边距，使内容与头部之间有更多呼吸空间 */

    padding-top: 20px;        /* 在容器内部顶部增加 20px 内边距 */
        }

        .main-content {
            width: 100%;
        }

        .sidebar {
            width: 100%;
            display: flex;
            flex-direction: column;
            gap: 30px;
        }

        section {
            margin-bottom: 30px;
        }

        h1 {
            font-size: 24px;
            margin-bottom: 16px;
            color: #2c3e50;
            border-bottom: 2px solid #e9ecef;
            padding-bottom: 8px;
        }

        h3 {
            font-size: 18px;
            margin-bottom: 7px;
            color: #2c3e50;
            border-bottom: 2px solid #e9ecef;
            padding-bottom: 6px;
        }

        .link-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
            gap: 12px;
        }

        .link-item {
            background: #fff;
            border: 1px solid #e0e0e0;
            border-radius: 6px;
            padding: 10px 8px;
            text-align: center;
            transition: all 0.2s;
        }

        .link-item a {
            color: #0d6efd;
            text-decoration: none;
            font-size: 14px;
            display: block;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .link-item:hover {
            background-color: #f1f8ff;
            transform: translateY(-2px);
            box-shadow: 0 2px 6px rgba(0,0,0,0.08);
        }

        .link-item:hover a {
            color: #0056b3;
        }

        .footer {
            text-align: center;
            color: #6c757d;
            font-size: 13px;
            margin-top: 20px;
            padding-top: 20px;
            border-top: 1px solid #eee;
            grid-column: span 2;
        }

        .footer a {
            color: #6c757d;
            text-decoration: none;
        }

        .footer img {
            vertical-align: middle;
            margin-right: 4px;
        }

        /* 文章区域图片居中 + 响应式 */
        #article img {
            max-width: 100%;
            height: auto;
            border-radius: 4px;
            margin: 12px auto;
            display: block;
        }

        /* 防止长链接/URL 撑破容器 */
        #article,
        #article p,
        #article a,
        #article strong {
            word-wrap: break-word;
            overflow-wrap: break-word;
            word-break: break-word;
        }

        /* 响应式：小屏时恢复单列 */
        @media (max-width: 992px) {
            .container {
                grid-template-columns: 1fr;
                max-width: 100%;
                padding: 0 12px;
                margin-top: 100px; /* 移动端稍高 */
padding-top: 100px;        /* 在容器内部顶部增加 20px 内边距 */
            }

            .footer {
                grid-column: span 1;
            }
        }

        @media (max-width: 768px) {
            header {
                flex-direction: column;
                align-items: flex-start;
                gap: 10px;
                padding: 10px 12px;
            }

            .search-box {
                width: 100%;
                max-width: none;
            }

            .search-box input[type="text"] {
                width: 100% !important;
                border-radius: 4px 4px 0 0;
            }

            .search-box input[type="submit"] {
                border-radius: 0 0 4px 4px;
                border-left: 1px solid #ccc;
            }

            .header-nav ul {
                flex-wrap: wrap;
                gap: 8px;
            }

            .link-grid {
                grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
                gap: 10px;
            }

            h1 {
                font-size: 20px;
            }

            /* 天气 iframe 响应式 */
            .header-weather iframe {
                width: 100% !important;
                max-width: 350px;
                height: 60px !important;
            }

            .container {
                margin-top: 120px; /* 移动端 header 可能两行，更高 */
            }
        }

        @media (max-width: 480px) {
            .link-grid {
                grid-template-columns: repeat(auto-fill, minmax(75px, 1fr));
            }

            .header-title h2 {
                font-size: 20px;
            }
        }
