/* --- CSS Variables for Theming --- */
:root {
    /* Light Mode (Default) */
    --bg-color: #F8F9FA;
    --text-color: #212529;
    --heading-color: #0056b3;
    --secondary-text-color: #6c757d;
    --border-color: #dee2e6;
    --cta-bg-color: #e9ecef;

    /* Typography & Layout */
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    --base-font-size: 17px; /* Between 16px and 18px */
    --line-height: 1.7; /* Between 1.5 and 1.8 */
    --content-max-width: 720px; /* Between 600px and 800px */
}

/* --- Dark Mode --- */
/* Auto-detect system preference */
@media (prefers-color-scheme: dark) {
    :root:not(.light-mode) {
        --bg-color: #121212;
        --text-color: #e0e0e0;
        --heading-color: #64b5f6;
        --secondary-text-color: #adb5bd;
        --border-color: #495057;
        --cta-bg-color: #212529;
    }
}

/* Manual override classes */
body.dark-mode {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --heading-color: #64b5f6;
    --secondary-text-color: #adb5bd;
    --border-color: #495057;
    --cta-bg-color: #212529;
}

body.light-mode {
    --bg-color: #F8F9FA;
    --text-color: #212529;
    --heading-color: #0056b3;
    --secondary-text-color: #6c757d;
    --border-color: #dee2e6;
    --cta-bg-color: #e9ecef;
}


/* --- General Styles & Reset --- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-family);
    font-size: var(--base-font-size);
    line-height: var(--line-height);
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}


/* --- Header & Theme Toggle --- */
.site-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-color);
    transition: border-color 0.3s ease;
}

.header-content {
    max-width: var(--content-max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#theme-toggle {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
    background-color: transparent;
    color: var(--text-color);
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    min-height: 44px; /* Minimum touch target size for accessibility */
    min-width: 44px;  /* Minimum touch target size for accessibility */
    display: flex;
    align-items: center;
    justify-content: center;
}

#theme-toggle:hover {
    background-color: var(--cta-bg-color);
}

#theme-toggle:focus {
    outline: 2px solid var(--heading-color);
    outline-offset: 2px;
}

/* Button styles */
.button {
    display: inline-block;
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.button:hover {
    background-color: var(--cta-bg-color);
}


/* --- Main Content & Article Layout --- */
main {
    padding: 2rem 1rem;
}

article {
    max-width: var(--content-max-width);
    margin: 0 auto;
}


/* --- Typography --- */
h1, h2, h3 {
    line-height: 1.3;
    color: var(--heading-color);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

h1 {
    font-size: 1.8rem;
    margin: 0;
}

h2 {
    font-size: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

h3 {
    font-size: 1.2rem;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

p {
    margin-top: 0;
    margin-bottom: 1.5rem; /* Sufficient paragraph spacing */
}

ol {
    padding-left: 1.5rem;
}

li {
    margin-bottom: 1rem;
}

strong {
    color: var(--heading-color);
}


/* --- Special Sections --- */
.reminder {
    text-align: center;
    padding: 1.5rem;
    margin: 1.5rem 0;
    background-color: var(--cta-bg-color);
    border: 2px solid var(--heading-color);
    border-radius: 8px;
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--heading-color);
}

.reminder p {
    margin: 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.cta {
    margin-top: 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(100, 181, 246, 0.15), rgba(255, 107, 107, 0.15));
    border-left: none;
    border-radius: 12px;
    text-align: center;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    animation: float 4s ease-in-out infinite;
}

.cta::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #FF6B6B, #FF8E53, #64B5F6);
    animation: gradientShift 3s infinite alternate;
}

@keyframes gradientShift {
    0% { background: linear-gradient(90deg, #FF6B6B, #FF8E53, #64B5F6); }
    100% { background: linear-gradient(90deg, #64B5F6, #FF6B6B, #FF8E53); }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

/* Prominent button styles */
.prominent-button {
    display: block;
    width: 80%;
    max-width: 500px;
    margin: 1.5rem auto 2rem;
    padding: 1.5rem 2rem;
    font-size: 1.4rem;
    font-weight: bold;
    text-align: center;
    text-decoration: none;
    color: white;
    background: linear-gradient(135deg, #FF6B6B, #FF8E53);
    border: none;
    border-radius: 50px;
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.5);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    letter-spacing: 1px;
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 15px rgba(255, 107, 107, 0.6); }
    50% { box-shadow: 0 0 25px rgba(255, 107, 107, 0.9); }
    100% { box-shadow: 0 0 15px rgba(255, 107, 107, 0.6); }
}

.prominent-button:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 12px 25px rgba(255, 107, 107, 0.8);
    background: linear-gradient(135deg, #FF8E53, #FF6B6B);
}

.prominent-button:active {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 6px 15px rgba(255, 107, 107, 0.6);
}

/* 添加脉冲动画效果 */
.prominent-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: 0.6s;
}

.prominent-button:hover::before {
    left: 100%;
}

/* --- Comparison Section Styles --- */
.comparison {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: 1.5rem 0;
    padding: 1rem;
    background-color: var(--bg-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.comparison-item {
    text-align: center;
    flex: 1;
    padding: 1rem;
    transition: transform 0.3s ease;
}

.comparison-item:hover {
    transform: translateY(-5px);
}

.comparison-item h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--heading-color);
    font-size: 1.3rem;
}

.comparison-vs {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--heading-color);
    margin: 0 1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Dramatic Comparison Section Styles */
.dramatic-comparison {
    margin: 2rem 0;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(100, 181, 246, 0.1), rgba(255, 107, 107, 0.1));
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.dramatic-comparison::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    pointer-events: none;
}

.comparison-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: 1.5rem 0;
}

.word-count {
    margin: 1rem 0;
}

.count {
    font-size: 3.5rem;
    font-weight: bold;
    color: var(--heading-color);
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.unit {
    font-size: 1rem;
    color: var(--secondary-text-color);
}

.book-thickness {
    height: 100px;
    width: 60px;
    margin: 1rem auto;
    background: linear-gradient(to right, #8B4513, #A0522D, #8B4513);
    border-radius: 3px;
    position: relative;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    border: 1px solid #5D2906;
}

.book-thickness.thick {
    width: 80px;
    background: linear-gradient(to right, #8B4513, #CD853F, #8B4513);
}

.book-thickness.thin {
    width: 40px;
    background: linear-gradient(to right, #8B4513, #D2B48C, #8B4513);
}

.book-thickness::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 5px,
        rgba(0,0,0,0.1) 5px,
        rgba(0,0,0,0.1) 10px
    );
    border-radius: 3px;
}

.comparison-item.large .count {
    font-size: 4rem;
    color: #FF6B6B;
    animation: pulseGlowRed 2s infinite;
}

@keyframes pulseGlowRed {
    0% { text-shadow: 0 0 5px rgba(255, 107, 107, 0.5); }
    50% { text-shadow: 0 0 20px rgba(255, 107, 107, 0.8); }
    100% { text-shadow: 0 0 5px rgba(255, 107, 107, 0.5); }
}

.comparison-item.small .count {
    font-size: 2.5rem;
    color: #64B5F6;
    animation: pulseGlowBlue 3s infinite;
}

@keyframes pulseGlowBlue {
    0% { text-shadow: 0 0 5px rgba(100, 181, 246, 0.5); }
    50% { text-shadow: 0 0 20px rgba(100, 181, 246, 0.8); }
    100% { text-shadow: 0 0 5px rgba(100, 181, 246, 0.5); }
}

.quote {
    font-size: 1rem;
    font-weight: bold;
    margin: 1rem 0 1.5rem;
    color: var(--heading-color);
    font-style: italic;
    position: relative;
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    border-left: 3px solid var(--heading-color);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
    animation: fadeInUp 0.8s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.quote::before,
.quote::after {
    content: '"';
    font-size: 1.8rem;
    color: var(--heading-color);
}

.quote::before {
    margin-right: 0.4rem;
}

.quote::after {
    margin-left: 0.4rem;
}

.highlight {
    text-align: center;
    font-weight: bold;
    font-size: 1rem;
    margin: 1rem 0 1.5rem;
    color: var(--heading-color);
}

/* --- Footer --- */
footer {
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 2rem;
    font-size: 0.9rem;
    color: var(--secondary-text-color);
    border-top: 1px solid var(--border-color);
}

/* ICP备案链接样式 */
footer a {
    color: inherit;
    text-decoration: none;
}

footer a:hover,
footer a:focus {
    text-decoration: underline;
}


/* --- Responsive Design --- */
/* Extra small devices (phones, 480px and down) */
@media (max-width: 480px) {
    .prominent-button {
        width: 90%;
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
    }
    body {
        font-size: 16px;
    }

    h1 {
        font-size: 1.4rem;
    }

    h2 {
        font-size: 1.2rem;
    }

    h3 {
        font-size: 1.1rem;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    #theme-toggle {
        margin-top: 10px;
        min-height: 44px;
        min-width: 44px;
        padding: 10px 15px;
    }

    main {
        padding: 1rem;
    }

    .cta {
        padding: 0.8rem 1rem;
    }
    
    /* Responsive for comparison section */
    .comparison {
        flex-direction: column;
        padding: 0.5rem;
    }
    
    .comparison-vs {
        padding: 1rem 0;
    }
    
    /* Responsive for dramatic comparison section */
    .dramatic-comparison {
        padding: 1rem;
    }
    
    .comparison-container {
        flex-direction: column;
    }
    
    .comparison-item {
        min-width: auto;
        margin-bottom: 1rem;
        padding: 1rem;
    }
    
    .comparison-vs {
        margin: 1rem 0;
        font-size: 1.2rem;
    }
    
    .comparison-item.large .count {
        font-size: 3rem;
    }
    
    .comparison-item.small .count {
        font-size: 2rem;
    }
    
    .quote {
        font-size: 0.9rem;
        padding: 0.6rem 1rem;
        margin: 0.5rem 0 1rem;
    }
    
    .quote::before,
    .quote::after {
        font-size: 1.5rem;
    }
    
    .book-thickness {
        height: 80px;
        width: 50px;
    }
    
    .book-thickness.thick {
        width: 70px;
    }
    
    .book-thickness.thin {
        width: 30px;
    }
}

/* Small devices (landscape phones, 481px and up) */
@media (min-width: 481px) and (max-width: 768px) {
    body {
        font-size: 16px;
    }

    h1 {
        font-size: 1.6rem;
    }

    h2 {
        font-size: 1.4rem;
    }

    h3 {
        font-size: 1.2rem;
    }

    #theme-toggle {
        min-height: 44px;
        min-width: 44px;
        padding: 8px 12px;
    }
    
    .quote {
        font-size: 1.1rem;
        padding: 0.7rem 1.2rem;
        margin: 0.8rem 0 1.2rem;
    }
    
    .comparison-vs {
        font-size: 1.3rem;
    }
}

/* Medium devices (tablets, 769px and up) */
@media (min-width: 769px) and (max-width: 1024px) {
    body {
        font-size: 17px;
    }

    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.3rem;
    }
    
    .quote {
        font-size: 1.2rem;
        padding: 0.8rem 1.3rem;
    }
    
    .comparison-vs {
        font-size: 1.4rem;
    }
}

/* Large devices (desktops, 1025px and up) */
@media (min-width: 1025px) {
    body {
        font-size: 17px;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.7rem;
    }

    h3 {
        font-size: 1.4rem;
    }
}

/* Unified prominent CTA section */
.prominent-cta {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.2), rgba(100, 181, 246, 0.2));
    border: 2px solid var(--heading-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
    text-align: center;
    font-weight: bold;
    font-size: 1.1rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.prominent-cta:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.prominent-cta::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #FF6B6B, #FF8E53, #64B5F6);
}

.prominent-cta p {
    margin: 0.5rem 0;
    color: var(--text-color);
}

.contact-info {
    font-size: 1.2rem;
    color: var(--heading-color);
    margin: 1rem 0;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Ensure proper contrast in both light and dark modes */
@media (prefers-color-scheme: dark) {
    .prominent-cta {
        background: linear-gradient(135deg, rgba(255, 107, 107, 0.1), rgba(100, 181, 246, 0.1));
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    }
    
    .prominent-cta:hover {
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    }
}
