/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Inter", "微软雅黑", "PingFang SC", Arial, sans-serif;
    scroll-behavior: smooth; /* 滚动不抖动 */
}

:root {
    /* 基础变量 */
    --primary-color: #4299e1;
    --primary-hover: #3182ce;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-color: #1e293b;
    --text-light: #64748b;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --ts-10-color: #94a3b8;
    --ts-13-color: #4299e1;
    
    /* 交互变量 */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 32px rgba(66, 153, 225, 0.1);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --transition: all 0.2s ease;
}

/* 暗黑模式变量 */
[data-theme="dark"] {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-color: #f8fafc;
    --text-light: #94a3b8;
    --border-color: #334155;
    --ts-10-color: #94a3b8;
    --ts-13-color: #60a5fa;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    padding: 20px 0;
    transition: var(--transition);
    line-height: 1.6;
    overflow-x: hidden; /* 防止横向滚动抖动 */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 28px;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.header p {
    color: var(--text-light);
    font-size: 16px;
}

/* 页面说明与首屏摘要 */
.hero-card {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.9fr);
    gap: 24px;
    align-items: center;
}

.hero-copy h2,
.seo-desc h2,
.content-card h2 {
    font-size: 24px;
    margin-bottom: 12px;
    color: var(--text-color);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    margin-bottom: 14px;
    border-radius: 999px;
    background: rgba(66, 153, 225, 0.12);
    color: var(--primary-color);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.hero-summary,
.seo-desc p {
    color: var(--text-light);
    font-size: 15px;
    line-height: 1.8;
}

.feature-list,
.content-list {
    margin-top: 16px;
    padding-left: 20px;
    color: var(--text-color);
}

.feature-list li,
.content-list li {
    margin-bottom: 10px;
}

.privacy-note {
    margin-top: 14px;
    padding: 12px 14px;
    border-left: 3px solid var(--primary-color);
    border-radius: var(--radius-sm);
    background: rgba(66, 153, 225, 0.08);
    color: var(--text-color);
    font-size: 14px;
}

.hero-media {
    margin: 0;
}

.hero-img {
    display: block;
    width: 100%;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.hero-media figcaption {
    margin-top: 10px;
    color: var(--text-light);
    font-size: 13px;
    text-align: center;
}

.seo-desc,
.content-card,
.noscript-card {
    margin-bottom: 20px;
}

.noscript-card {
    color: var(--warning-color);
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.2);
}

/* 主题切换按钮 */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 44px; /* 统一按钮大小 */
    height: 44px;
    border-radius: 50%;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    z-index: 999;
    box-shadow: var(--shadow-sm);
}

.theme-toggle:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-1px); /* hover微动效 */
    box-shadow: var(--shadow-md);
}

/* 收藏提示 */
.collect-tip {
    position: fixed;
    top: 70px;
    right: 20px;
    background: var(--primary-color);
    color: white;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    z-index: 998;
    opacity: 0.9;
    transition: all 0.3s ease;
    display: none;
    box-shadow: var(--shadow-md);
}

/* 标签页样式 */
.tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.tab-btn {
    padding: 12px 24px; /* 统一按钮内边距 */
    height: 44px; /* 统一按钮高度 */
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.tab-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.tab-btn:hover:not(.active) {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px); /* hover微动效 */
    box-shadow: var(--shadow-sm);
}

/* 卡片样式 */
.card {
    background-color: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 25px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md); /* 卡片hover微动效 */
}

/* 输入区域样式 */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

/* 输入框容器（带清空按钮） */
.input-wrapper {
    position: relative;
    width: 100%;
}

.input-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--card-bg);
    color: var(--text-color);
    font-size: 16px;
    transition: var(--transition);
    height: 44px; /* 统一输入框高度 */
}

/* 输入框实时反馈样式 */
.input-control.valid {
    border-color: var(--success-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.input-control.invalid {
    border-color: var(--error-color);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.input-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.input-control::placeholder {
    color: var(--text-light);
}

/* 多行输入框特殊样式 */
.batch-input {
    height: auto !important;
    min-height: 120px;
    resize: vertical;
    padding: 12px 16px;
}

/* 清空按钮 */
.clear-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
}

.clear-btn:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.05); /* hover微动效 */
}

.batch-clear-btn {
    top: 12px;
    right: 12px;
}

/* 搜索框样式 */
.search-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--card-bg);
    color: var(--text-color);
    font-size: 16px;
    margin-bottom: 15px;
    height: 44px; /* 统一高度 */
}

/* 按钮样式（统一大小） */
.btn {
    padding: 12px 24px;
    height: 44px; /* 统一按钮高度 */
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 16px;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px); /* hover上浮 */
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px); /* hover上浮 */
    box-shadow: var(--shadow-sm);
}

.btn-sm {
    padding: 6px 12px;
    height: 32px; /* 小按钮统一高度 */
    font-size: 14px;
}

.btn-group {
    display: flex;
    gap: 10px; /* 统一按钮间距 */
    flex-wrap: wrap;
    margin-bottom: 20px;
}

/* 偏移计算组样式 */
.offset-group {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.offset-input {
    flex: 0 0 100px;
}

.offset-select {
    flex: 0 0 150px;
}

/* 结果区域样式 */
.result-area {
    padding: 20px;
    border-radius: var(--radius-md);
    background-color: rgba(66, 153, 225, 0.05);
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
    min-height: 80px;
    white-space: pre-wrap;
    word-wrap: break-word;
    transition: var(--transition);
}

.result-area:hover {
    box-shadow: var(--shadow-sm);
}

.result-title {
    font-weight: 500;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.result-content {
    color: var(--text-color);
    font-size: 16px;
    line-height: 1.8;
}

/* 关键数字高亮 */
.result-content strong {
    color: var(--primary-color);
    font-size: 18px; /* 加大关键数字 */
    font-weight: 600;
}

/* 时间戳颜色高亮 */
.ts-10 {
    color: var(--ts-10-color);
    font-weight: 600;
    font-size: 18px; /* 高亮数字加大 */
}
.ts-13 {
    color: var(--ts-13-color);
    font-weight: 600;
    font-size: 18px; /* 高亮数字加大 */
}

/* 提示样式 */
.tip {
    font-size: 14px;
    color: var(--text-light);
    margin-top: 8px;
}

.ts-validity-tip {
    margin-top: 5px;
    font-weight: 500;
}

.success-tip {
    color: var(--success-color);
    display: none;
    padding: 10px;
    background-color: rgba(16, 185, 129, 0.1);
    border-radius: var(--radius-sm);
    margin: 10px 0;
}

.error-tip {
    color: var(--error-color);
    display: none;
    padding: 10px;
    background-color: rgba(239, 68, 68, 0.1);
    border-radius: var(--radius-sm);
    margin: 10px 0;
}

/* 分隔线 */
.divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 30px 0;
}

/* 高级功能样式 */
.advanced-func {
    display: none;
}

/* 历史记录样式 */
.history-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-top: 10px;
}

.history-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.history-item:last-child {
    border-bottom: none;
}

.history-item:hover {
    background-color: rgba(66, 153, 225, 0.05);
    transform: translateX(2px); /* hover微动效 */
}

.history-item span {
    flex: 1;
    min-width: 0;
}

.history-delete {
    border: none;
    background: transparent;
    color: var(--error-color);
    cursor: pointer;
    opacity: 0.75;
    transition: var(--transition);
    font-size: 14px;
}

.history-item:hover .history-delete {
    opacity: 1;
}

.history-delete:hover {
    color: #dc2626;
}

.empty-item {
    justify-content: center !important;
    color: var(--text-light);
    cursor: default !important;
}

.empty-item:hover {
    background-color: transparent !important;
    transform: none !important;
}

/* 最近使用记录样式 */
.recent-records {
    margin: 10px 0;
    padding: 10px;
    background-color: rgba(66, 153, 225, 0.05);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.recent-title {
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--primary-color);
}

.recent-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.recent-item {
    appearance: none;
    padding: 4px 8px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-color);
}

.recent-item:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* 使用教程样式 */
.tutorial-card {
    margin-top: 20px;
}
.tutorial-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 10px 0;
}
.tutorial-toggle h2 {
    font-size: 18px;
    margin: 0;
}
.tutorial-toggle i {
    transition: var(--transition);
}
.tutorial-content {
    display: none;
    margin-top: 20px;
    font-size: 14px;
    line-height: 1.8;
}

/* FAQ样式 */
.faq-card {
    margin-top: 20px;
}
.faq-title {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--primary-color);
}
.faq-item {
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}
.faq-item:last-child {
    border-bottom: none;
}
.faq-question {
    font-weight: 500;
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--primary-color);
}
.faq-answer {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-color);
}

/* 快捷时间按钮组 */
.quick-time-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.quick-btn {
    height: 44px; /* 统一高度 */
}

/* 玻璃拟态倒计时样式 */
.countdown-card {
    background: linear-gradient(135deg, rgba(66, 153, 225, 0.1), rgba(66, 153, 225, 0.05));
    border: 1px solid rgba(66, 153, 225, 0.2);
    border-radius: var(--radius-xl);
    padding: 24px;
    margin-top: 16px;
    text-align: center;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
}
.countdown-empty {
    font-size: 15px;
    color: var(--text-light);
}
.countdown-title {
    font-size: 16px;
    color: var(--primary-color);
    margin-bottom: 16px;
    font-weight: 600;
}
.countdown-box {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
}
.countdown-item {
    background: rgba(255, 255, 255, 0.9);
    color: #1e293b;
    width: 60px;
    height: 60px;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: var(--transition);
}

.countdown-item:hover {
    transform: translateY(-2px); /* hover微动效 */
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

/* 暗黑模式适配倒计时 */
[data-theme="dark"] .countdown-item {
    background: rgba(30, 41, 59, 0.9);
    color: #f8fafc;
}
.countdown-num {
    font-size: 20px;
    line-height: 1;
    color: var(--primary-color); /* 关键数字高亮 */
}
.countdown-label {
    font-size: 11px;
    color: #64748b;
    margin-top: 2px;
}
[data-theme="dark"] .countdown-label {
    color: #94a3b8;
}
.countdown-target {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 8px;
}

/* 时间对比样式 */
.compare-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    width: 100%;
}

.compare-row .input-wrapper {
    flex: 1;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

/* 加载点点动画 */
.loading-dots {
    display: inline-block;
    font-size: 20px;
    animation: dots 1.5s infinite;
    letter-spacing: 2px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes dots {
    0%, 100% { content: '.'; }
    25% { content: '..'; }
    50% { content: '...'; }
    75% { content: '....'; }
}

/* 错误抖动动画 */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

/* 复制成功动画 */
.copy-success {
    position: relative;
}

.copy-success::after {
    content: '✅ 复制成功';
    position: absolute;
    top: -30px;
    right: 0;
    background-color: var(--success-color);
    color: white;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    animation: fadeOut 2s ease-in-out forwards;
}

@keyframes fadeOut {
    0% { opacity: 1; transform: translateY(0); }
    80% { opacity: 1; transform: translateY(-5px); }
    100% { opacity: 0; transform: translateY(-10px); }
}

/* 隐藏元素 */
.hidden {
    display: none;
}

/* 响应式样式（移动端完美适配） */
@media (max-width: 768px) {
    .header h1 {
        font-size: 24px;
    }

    .hero-card {
        grid-template-columns: 1fr;
    }

    .hero-copy h2,
    .seo-desc h2,
    .content-card h2 {
        font-size: 20px;
    }

    .card {
        padding: 20px;
    }

    .btn {
        width: 100%;
    }

    .tabs {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 10px;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch; /* 移动端顺滑滚动 */
    }

    .tab-btn {
        white-space: nowrap;
        flex-shrink: 0;
    }

    .theme-toggle {
        width: 40px;
        height: 40px;
    }

    .compare-row {
        flex-direction: column;
    }

    /* 移动端倒计时适配 */
    .countdown-item {
        width: 50px;
        height: 50px;
    }
    .countdown-num {
        font-size: 18px;
    }

    /* 移动端按钮组适配 */
    .btn-group {
        flex-direction: column;
        gap: 8px;
    }

    .offset-group {
        flex-direction: column;
    }

    .offset-input, .offset-select {
        flex: 1 1 100%;
        width: 100%;
    }

    /* 移动端输入框适配 */
    .input-control {
        font-size: 15px;
        padding: 10px 14px;
    }

    /* 移动端结果区域适配 */
    .result-content {
        font-size: 15px;
    }

    /* 移动端最近记录适配 */
    .recent-list {
        flex-direction: column;
        gap: 4px;
    }

    .recent-item {
        width: 100%;
        justify-content: center;
    }

    .history-delete {
        width: auto;
    }
}

/* 防止移动端点击高亮 */
* {
    -webkit-tap-highlight-color: transparent;
}

/* 优化滚动条 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--text-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}
