@media screen and (min-width: 320px) and (max-width: 768px) {
    :root {
        --primary-color: #1a73e8;
        --secondary-color: #202124;
        --accent-color: #ea4335;
        --text-primary: #202124;
        --text-secondary: #5f6368;
        --background: #ffffff;
        --background-secondary: #f8f9fa;
        --border-color: #dadce0;
        --header-height: 56px;
        --bottom-nav-height: 60px;
        --sidebar-width: 280px;
    }

    body {
        min-height: 100vh;
        background-color: var(--background);
        color: var(--text-primary);
    }

    #app {
        min-height: 100vh;
        display: flex;
        flex-direction: column;
    }

    .header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: var(--header-height);
        background-color: var(--primary-color);
        color: white;
        z-index: 1000;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    .header-content {
        height: 100%;
        padding: 0 16px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .menu-btn {
        width: 40px;
        height: 40px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 5px;
    }

    .menu-btn span {
        width: 24px;
        height: 2px;
        background-color: white;
        border-radius: 2px;
        transition: all 0.3s ease;
    }

    .logo {
        font-size: 18px;
        font-weight: 600;
        text-align: center;
    }

    .header-right {
        width: 40px;
    }

    .main {
        flex: 1;
        padding-top: var(--header-height);
        padding-bottom: var(--bottom-nav-height);
        min-height: 100vh;
    }

    #page-container {
        padding: 16px;
    }

    .bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: var(--bottom-nav-height);
        background-color: var(--background);
        border-top: 1px solid var(--border-color);
        display: flex;
        justify-content: space-around;
        align-items: center;
        z-index: 1000;
    }

    .nav-item {
        flex: 1;
        text-align: center;
        padding: 8px 4px;
        font-size: 11px;
        color: var(--text-secondary);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transition: color 0.2s ease;
    }

    .nav-item:hover {
        color: var(--primary-color);
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 2000;
        visibility: hidden;
    }

    .sidebar.active {
        visibility: visible;
    }

    .sidebar-overlay {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .sidebar.active .sidebar-overlay {
        opacity: 1;
    }

    .sidebar-content {
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        width: var(--sidebar-width);
        background-color: var(--background);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        display: flex;
        flex-direction: column;
    }

    .sidebar.active .sidebar-content {
        transform: translateX(0);
    }

    .sidebar-header {
        height: var(--header-height);
        padding: 0 16px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-bottom: 1px solid var(--border-color);
        background-color: var(--primary-color);
        color: white;
    }

    .sidebar-header h2 {
        font-size: 18px;
        font-weight: 600;
    }

    .close-btn {
        width: 40px;
        height: 40px;
        font-size: 28px;
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .category-list {
        flex: 1;
        overflow-y: auto;
        padding: 16px 0;
    }

    .category-item {
        display: block;
        padding: 14px 24px;
        font-size: 16px;
        color: var(--text-primary);
        transition: background-color 0.2s ease;
    }

    .category-item:hover,
    .category-item.active {
        background-color: var(--background-secondary);
        color: var(--primary-color);
    }
    
    .sidebar-ad {
        padding: 16px;
        border-top: 1px solid var(--border-color);
    }
    
    .footer-ad {
        padding: 16px;
        background-color: var(--background-secondary);
        border-top: 1px solid var(--border-color);
        margin-bottom: var(--bottom-nav-height);
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .welcome-content {
        text-align: center;
        padding: 40px 16px;
    }

    .welcome-content h2 {
        font-size: 24px;
        margin-bottom: 16px;
        color: var(--text-primary);
    }

    .welcome-content p {
        font-size: 16px;
        color: var(--text-secondary);
        line-height: 1.6;
    }

    .page-content {
        padding: 16px 0;
    }

    .page-content h2 {
        font-size: 24px;
        margin-bottom: 20px;
        color: var(--text-primary);
        padding-bottom: 12px;
        border-bottom: 2px solid var(--primary-color);
    }

    .page-content p {
        font-size: 16px;
        color: var(--text-secondary);
        line-height: 1.8;
        margin-bottom: 16px;
    }

    .category-section {
        margin-bottom: 24px;
    }

    .category-title {
        font-size: 20px;
        font-weight: 700;
        color: var(--text-primary);
        margin-bottom: 16px;
        padding-left: 4px;
        border-left: 4px solid var(--primary-color);
    }

    .article-list {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .article-card {
        background-color: var(--background);
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        transition: box-shadow 0.2s ease;
        cursor: pointer;
    }

    .article-card:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .article-card-image {
        width: 100%;
        height: 180px;
        object-fit: cover;
        background-color: var(--background-secondary);
    }

    .article-card-content {
        padding: 12px;
    }

    .article-card-title {
        font-size: 16px;
        font-weight: 600;
        color: var(--text-primary);
        line-height: 1.4;
        margin-bottom: 8px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .article-card-summary {
        font-size: 14px;
        color: var(--text-secondary);
        line-height: 1.5;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .bottom-nav .nav-item {
        font-size: 12px;
    }

    .content-section {
        margin-bottom: 28px;
        padding-bottom: 20px;
        border-bottom: 1px solid var(--border-color);
    }

    .content-section:last-child {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }

    .content-section h3 {
        font-size: 18px;
        font-weight: 700;
        color: var(--text-primary);
        margin-bottom: 12px;
    }

    .content-section p {
        font-size: 15px;
        color: var(--text-secondary);
        line-height: 1.7;
        margin-bottom: 12px;
    }

    .content-section p:last-child {
        margin-bottom: 0;
    }

    .content-list {
        margin: 16px 0;
        padding-left: 24px;
    }

    .content-list li {
        font-size: 15px;
        color: var(--text-secondary);
        line-height: 1.7;
        margin-bottom: 10px;
    }

    .content-list li:last-child {
        margin-bottom: 0;
    }

    .content-list strong {
        color: var(--text-primary);
        font-weight: 600;
    }

    .article-detail {
        padding: 0;
    }

    .article-cover {
        width: 100%;
        height: 220px;
        object-fit: cover;
    }

    .article-header {
        padding: 16px;
    }

    .article-category {
        display: inline-block;
        padding: 4px 12px;
        background-color: var(--primary-color);
        color: white;
        font-size: 12px;
        font-weight: 600;
        border-radius: 4px;
        margin-bottom: 12px;
    }

    .article-title {
        font-size: 24px;
        font-weight: 700;
        color: var(--text-primary);
        line-height: 1.3;
        margin-bottom: 8px;
    }

    .article-subtitle {
        font-size: 16px;
        color: var(--text-secondary);
        line-height: 1.5;
        margin-bottom: 16px;
    }

    .article-meta {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-bottom: 20px;
    }

    .author-avatar {
        width: 44px;
        height: 44px;
        border-radius: 50%;
        background-color: var(--primary-color);
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 16px;
        font-weight: 600;
    }

    .author-info {
        flex: 1;
    }

    .author-name {
        font-size: 14px;
        font-weight: 600;
        color: var(--text-primary);
    }

    .author-bio {
        font-size: 12px;
        color: var(--text-secondary);
    }

    .article-time {
        font-size: 12px;
        color: var(--text-secondary);
    }

    .article-content {
        padding: 0 16px 16px;
    }

    .article-content .content-paragraph {
        font-size: 16px;
        line-height: 1.8;
        color: var(--text-primary);
        margin-bottom: 16px;
    }

    .article-content .content-heading {
        font-size: 20px;
        font-weight: 700;
        color: var(--text-primary);
        margin: 24px 0 12px;
    }

    .article-content .content-list {
        margin: 0 0 16px 20px;
    }

    .article-content .content-list li {
        font-size: 16px;
        line-height: 1.8;
        color: var(--text-primary);
        margin-bottom: 12px;
        list-style-type: disc;
    }

    .article-tags {
        padding: 0 16px 20px;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .tag {
        padding: 6px 12px;
        background-color: var(--background-secondary);
        color: var(--text-secondary);
        font-size: 13px;
        border-radius: 16px;
    }
    
    .article-ad {
        padding: 16px;
        background-color: var(--background-secondary);
        border-top: 1px solid var(--border-color);
        border-bottom: 1px solid var(--border-color);
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .related-section {
        padding: 20px 16px;
        border-top: 8px solid var(--background-secondary);
    }

    .related-title {
        font-size: 20px;
        font-weight: 700;
        color: var(--text-primary);
        margin-bottom: 16px;
    }

    .related-list {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .related-card {
        display: flex;
        gap: 12px;
        background-color: var(--background);
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        cursor: pointer;
    }

    .related-card-image {
        width: 100px;
        height: 75px;
        object-fit: cover;
        background-color: var(--background-secondary);
        flex-shrink: 0;
    }

    .related-card-content {
        flex: 1;
        padding: 8px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .related-card-title {
        font-size: 14px;
        font-weight: 600;
        color: var(--text-primary);
        line-height: 1.4;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .back-button {
        position: absolute;
        left: 16px;
        top: 50%;
        transform: translateY(-50%);
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 24px;
        cursor: pointer;
        z-index: 10;
    }

    .header-detail {
        padding-left: 56px;
    }

    .ad-container {
        width: 100%;
        margin: 16px 0;
        padding: 12px 0;
        background-color: var(--background-secondary);
        border-radius: 8px;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .ad-container-top {
        margin-bottom: 24px;
    }

    .ad-container-middle {
        margin: 24px 0;
    }

    .ad-container-bottom {
        margin-top: 24px;
        margin-bottom: 0;
    }

    .ad-placeholder {
        text-align: center;
        padding: 20px;
        color: var(--text-secondary);
        font-size: 14px;
    }

    .ad-placeholder-title {
        font-weight: 600;
        color: var(--primary-color);
        margin-bottom: 8px;
    }

    .ad-unit {
        width: 100%;
        min-height: 100px;
    }
}

/* @media screen and (max-width: 319px), screen and (min-width: 769px) {
    body::before {
        content: "This website is optimized for mobile devices (320px - 768px). Please use a mobile device or adjust your browser window size.";
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        text-align: center;
        padding: 40px;
        background-color: #f8f9fa;
        border: 2px solid #dadce0;
        border-radius: 8px;
        font-size: 16px;
        color: #5f6368;
        max-width: 400px;
        z-index: 9999;
    }

    body::after {
        content: "";
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(255, 255, 255, 0.95);
        z-index: 9998;
    }
} */
