:root {
    --color-parchment: #f5f4ed;
    --color-ivory: #faf9f5;
    --color-white: #ffffff;
    --color-warm-sand: #e8e6dc;
    --color-dark-surface: #30302e;
    --color-deep-dark: #141413;
    --color-anthropic-black: #141413;
    --color-terracotta: #c96442;
    --color-coral: #d97757;
    --color-error-crimson: #b53333;
    --color-focus-blue: #3898ec;
    --color-charcoal-warm: #4d4c48;
    --color-olive-gray: #5e5d59;
    --color-stone-gray: #87867f;
    --color-dark-warm: #3d3d3a;
    --color-warm-silver: #b0aea5;
    --color-border-cream: #f0eee6;
    --color-border-warm: #e8e6dc;
    --color-border-dark: #30302e;
    --color-ring-warm: #d1cfc5;
    --color-ring-deep: #c2c0b6;
    
    --font-serif: Georgia, 'Times New Roman', Times, serif;
    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    
    --radius-sharp: 4px;
    --radius-subtle: 6px;
    --radius-comfortable: 8px;
    --radius-generous: 12px;
    --radius-very: 16px;
    --radius-highly: 24px;
    --radius-maximum: 32px;
    
    --shadow-ring: 0px 0px 0px 1px var(--color-ring-warm);
    --shadow-whisper: rgba(0, 0, 0, 0.05) 0px 4px 24px;

    --touch-target: 44px;
}

@viewport {
    width: device-width;
    initial-scale: 1.0;
}

html {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-anthropic-black);
    background-color: var(--color-parchment);
    min-height: 100vh;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
    -webkit-overflow-scrolling: touch;
    overflow-scrolling: touch;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

button {
    cursor: pointer;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: inherit;
    min-height: var(--touch-target);
    min-width: var(--touch-target);
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
    -ms-touch-action: manipulation;
}

input, select, textarea {
    outline: none;
    font-family: inherit;
    font-size: inherit;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="tel"],
textarea {
    -webkit-user-select: text;
    user-select: text;
    padding: 12px 16px;
    border: 1px solid var(--color-border-cream);
    border-radius: var(--radius-generous);
    background-color: var(--color-ivory);
    color: var(--color-anthropic-black);
    width: 100%;
    box-sizing: border-box;
    min-height: 48px;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
textarea:focus {
    border-color: var(--color-terracotta);
    box-shadow: 0 0 0 3px rgba(201, 100, 66, 0.1);
}

@media (max-width: 640px) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="search"],
    input[type="tel"],
    textarea {
        font-size: 16px;
    }
    
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .btn,
    .tool-card,
    .category-item,
    .modal-content {
        animation: none !important;
        transition: none !important;
    }
    
    .btn {
        transition: background-color 0.15s ease, transform 0.15s ease !important;
    }
    
    .tool-card,
    .category-item {
        transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.15s ease !important;
    }
    
    .modal-content {
        transition: transform 0.3s ease, opacity 0.3s ease !important;
    }
}

::selection {
    background-color: var(--color-terracotta);
    color: var(--color-ivory);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    border-radius: var(--radius-generous);
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s ease;
    min-height: 52px;
    min-width: 52px;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: auto;
    user-select: auto;
    touch-action: manipulation;
    -ms-touch-action: manipulation;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    will-change: transform, box-shadow;
    cursor: pointer;
}

.btn-terracotta {
    background-color: var(--color-terracotta);
    color: var(--color-ivory);
    box-shadow: 0px 0px 0px 0px var(--color-terracotta), 0px 0px 0px 1px var(--color-terracotta);
}

.btn-terracotta:hover, .btn-terracotta:active {
    transform: translateY(-1px);
    box-shadow: 0px 0px 0px 0px var(--color-terracotta), 0px 0px 0px 1px var(--color-terracotta), rgba(201, 100, 66, 0.3) 0px 4px 12px;
}

.btn-terracotta:active {
    transform: scale(0.96);
}

.btn-sand {
    background-color: var(--color-warm-sand);
    color: var(--color-charcoal-warm);
    padding: 10px 16px;
    box-shadow: 0px 0px 0px 0px var(--color-warm-sand), 0px 0px 0px 1px var(--color-ring-warm);
}

.btn-sand:hover, .btn-sand:active {
    box-shadow: 0px 0px 0px 0px var(--color-warm-sand), 0px 0px 0px 1px var(--color-ring-deep);
}

.btn-sand:active {
    transform: scale(0.96);
}

.btn-white {
    background-color: var(--color-white);
    color: var(--color-anthropic-black);
    padding: 10px 16px;
    border-radius: var(--radius-generous);
}

.btn-white:hover, .btn-white:active {
    background-color: var(--color-warm-sand);
}

.btn-white:active {
    transform: scale(0.96);
}

.btn-dark {
    background-color: var(--color-dark-surface);
    color: var(--color-ivory);
    padding: 10px 16px;
    box-shadow: 0px 0px 0px 0px var(--color-dark-surface), 0px 0px 0px 1px var(--color-border-dark);
}

.btn-dark:hover, .btn-dark:active {
    box-shadow: 0px 0px 0px 0px var(--color-dark-surface), 0px 0px 0px 1px var(--color-warm-silver);
}

.btn-dark:active {
    transform: scale(0.96);
}

.card {
    background-color: var(--color-ivory);
    border: 1px solid var(--color-border-cream);
    border-radius: var(--radius-comfortable);
    padding: 24px;
    transition: all 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-whisper);
    border-color: var(--color-border-warm);
}

.card-dark {
    background-color: var(--color-dark-surface);
    border-color: var(--color-border-dark);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(20, 20, 19, 0.6);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
    -webkit-overflow-scrolling: touch;
    overflow-scrolling: touch;
}

.modal-content {
    background-color: var(--color-ivory);
    border-radius: var(--radius-very) var(--radius-very) 0 0;
    width: 100%;
    max-width: 480px;
    padding: 24px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
    position: relative;
    animation: slideUp 0.3s ease;
    max-height: 85vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    will-change: transform, opacity;
}

.modal-content .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 32px;
    border-radius: var(--radius-generous);
    font-size: 16px;
    font-weight: 600;
    min-height: 56px;
    width: 61.8%;
    max-width: 320px;
    margin: 0 auto;
    transition: all 0.15s ease;
    transform: translateZ(0);
    will-change: transform, box-shadow;
    touch-action: manipulation;
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
}

.modal-content .btn:active {
    transform: scale(0.98);
}

.modal-content .btn.touched {
    transform: scale(0.96);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: var(--touch-target);
    height: var(--touch-target);
    border-radius: 50%;
    background-color: var(--color-warm-sand);
    color: var(--color-charcoal-warm);
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    -ms-touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.modal-close:hover, .modal-close:active,
.modal-close.touched {
    background-color: var(--color-border-warm);
    transform: scale(0.95);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.toast {
    position: fixed;
    bottom: calc(32px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    padding: 14px 24px;
    border-radius: var(--radius-generous);
    color: var(--color-ivory);
    font-size: 14px;
    z-index: 2000;
    animation: slideUp 0.3s ease;
    max-width: calc(100% - 32px);
    text-align: center;
}

.toast.success {
    background-color: #4CAF50;
}

.toast.error {
    background-color: var(--color-error-crimson);
}

.toast.info {
    background-color: var(--color-focus-blue);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    font-weight: 500;
    color: var(--color-anthropic-black);
    line-height: 1.2;
    margin: 0 0 16px 0;
}

h1 { font-size: 3rem; line-height: 1.10; }
h2 { font-size: 2.5rem; line-height: 1.20; }
h3 { font-size: 1.8rem; line-height: 1.15; }
h4 { font-size: 1.4rem; line-height: 1.20; }
h5 { font-size: 1.2rem; line-height: 1.20; }
h6 { font-size: 1rem; line-height: 1.20; }

p {
    color: var(--color-olive-gray);
    line-height: 1.6;
    margin: 0 0 16px 0;
}

a {
    color: var(--color-dark-warm);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover, a:active {
    color: var(--color-terracotta);
}

@media (min-width: 768px) {
    h1 { font-size: 4rem; }
    h2 { font-size: 3.25rem; }
    h3 { font-size: 2rem; }
    h4 { font-size: 1.6rem; }

    .container {
        padding: 0 24px;
    }

    .modal-overlay {
        align-items: center;
    }

    .modal-content {
        border-radius: var(--radius-very);
        max-height: 90vh;
        padding-bottom: 32px;
        animation: slideUpTablet 0.3s ease;
    }
}

@keyframes slideUpTablet {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@media (max-width: 640px) {
    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.8rem; }
    h3 { font-size: 1.5rem; }
    h4 { font-size: 1.25rem; }

    .btn {
        padding: 14px 24px;
        font-size: 16px;
        width: 100%;
    }

    .card {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 15px;
    }

    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.3rem; }

    .container {
        padding: 0 12px;
    }
}

/* 页脚样式 */
.site-footer {
    background-color: var(--color-dark-surface);
    color: var(--color-warm-silver);
    padding: 24px 16px;
    margin-top: 48px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-links {
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--color-warm-silver);
    font-size: 14px;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--color-ivory);
}

.footer-compliance {
    font-size: 13px;
    color: var(--color-stone-gray);
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}