:root {
    --primary: #3b82f6;
    --primary-light: #60a5fa;
    --primary-dark: #1d4ed8;
    --accent: #f59e0b;
    --accent-light: #fbbf24;
    --success: #10b981;
    --danger: #ef4444;
    --purple: #8b5cf6;
    --bg: #f1f5f9;
    --surface: #ffffff;
    --surface-glass: rgba(255, 255, 255, 0.9);
    --surface-2: #f8fafc;
    --text: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-md: 0 6px 12px -2px rgb(0 0 0 / 0.1), 0 3px 6px -3px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 40px -5px rgb(0 0 0 / 0.15);
    --radius: 20px;
    --radius-sm: 12px;
    --radius-xs: 8px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f172a;
        --surface: #1e293b;
        --surface-glass: rgba(30, 41, 59, 0.95);
        --surface-2: #334155;
        --text: #f8fafc;
        --text-secondary: #cbd5e1;
        --text-muted: #94a3b8;
        --border: #334155;
        --border-light: #475569;
    }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 4px; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* ===== 导航栏 ===== */
.top-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    background: var(--surface-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border);
    transition: all 0.3s ease;
}

.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
    text-decoration: none;
}

.nav-logo-icon {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.nav-links { display: flex; gap: 8px; }

.nav-link {
    padding: 8px 16px;
    border-radius: var(--radius-xs);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-link:hover { background: var(--surface-2); color: var(--primary); }

@media (max-width: 640px) { .nav-links { display: none; } }

/* ===== Hero区域 ===== */
header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 40%, #334155 100%);
    color: white;
    padding: 130px 0 100px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(59,130,246,0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(139,92,246,0.1) 0%, transparent 40%);
}

header::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 80px;
    background: linear-gradient(to top, var(--bg), transparent);
}

.header-content { position: relative; z-index: 1; max-width: 800px; margin: 0 auto; padding: 0 24px; }

.header-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #94a3b8;
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
}

.header-badge .pulse {
    width: 8px; height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

h1 {
    font-size: clamp(1.8rem, 5vw, 2.8rem);
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -1px;
    line-height: 1.2;
    background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: clamp(1rem, 2.5vw, 1.15rem);
    color: #94a3b8;
    font-weight: 400;
    line-height: 1.7;
    max-width: 600px;
    margin: 0 auto;
}

/* ===== 主转换区域 ===== */
.hero-section {
    margin-top: -60px;
    position: relative;
    z-index: 2;
    margin-bottom: 48px;
}

.hero-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    padding: 40px;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.hero-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--purple), var(--accent), var(--primary));
    background-size: 300% 100%;
    animation: gradient-shift 8s ease infinite;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* 当前时间戳展示 */
.current-timestamp-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border);
}

@media (max-width: 640px) {
    .current-timestamp-bar { grid-template-columns: 1fr; }
}

.ts-display-card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.ts-display-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.ts-display-card::after {
    content: '点击复制';
    position: absolute;
    top: 8px; right: 8px;
    font-size: 0.65rem;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 0.2s;
}

.ts-display-card:hover::after { opacity: 1; }

.ts-display-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.ts-display-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    font-family: "SF Mono", Monaco, Consolas, monospace;
    font-variant-numeric: tabular-nums;
    word-break: break-all;
}

.ts-display-unit {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* 转换器主体 */
.converter-area {
    display: grid;
    gap: 24px;
}

.converter-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 16px;
    align-items: end;
}

@media (max-width: 768px) {
    .converter-row { grid-template-columns: 1fr; }
    .converter-arrow { transform: rotate(90deg); margin: 0 auto; }
}

.input-group { display: flex; flex-direction: column; gap: 8px; }

.input-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.input-label .tag {
    font-size: 0.7rem;
    padding: 2px 8px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 100px;
    color: var(--text-muted);
    font-weight: 500;
}

.input-field {
    width: 100%;
    padding: 14px 18px;
    font-size: 1.1rem;
    font-family: "SF Mono", Monaco, Consolas, monospace;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    transition: all 0.2s;
    outline: none;
}

.input-field:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.input-field::placeholder { color: var(--text-muted); opacity: 0.6; }

.converter-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.converter-arrow:hover {
    transform: scale(1.1) rotate(180deg);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.converter-arrow:active { transform: scale(0.95); }

/* 选项栏 */
.options-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    padding: 16px;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.option-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.option-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.option-select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    background: var(--surface);
    color: var(--text);
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
}

.option-select:focus { border-color: var(--primary); }

/* 转换按钮 */
.convert-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    width: 100%;
}

.convert-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4);
}

.convert-btn:active { transform: translateY(0); }

/* 结果区域 */
.result-area {
    margin-top: 24px;
    padding: 24px;
    background: linear-gradient(135deg, rgba(59,130,246,0.05), rgba(139,92,246,0.05));
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: none;
}

.result-area.show { display: block; animation: fadeIn 0.3s ease; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    transition: all 0.2s;
}

.result-item:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-sm);
}

.result-info { min-width: 0; }

.result-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 4px;
}

.result-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    font-family: "SF Mono", Monaco, Consolas, monospace;
    word-break: break-all;
}

.copy-btn {
    padding: 6px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    margin-left: 12px;
}

.copy-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.copy-btn.copied {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

/* ===== 快捷参考 ===== */
.section { margin-bottom: 56px; }

.section-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}

.section-icon {
    width: 44px; height: 44px;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.3rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.5px;
}

.section-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 4px;
}

.ref-table-wrapper {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.ref-table {
    width: 100%;
    border-collapse: collapse;
}

.ref-table th,
.ref-table td {
    padding: 14px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.ref-table th {
    background: var(--surface-2);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ref-table tr:last-child td { border-bottom: none; }

.ref-table td {
    font-size: 0.95rem;
    color: var(--text);
    font-family: "SF Mono", Monaco, Consolas, monospace;
}

.ref-table .label-cell {
    font-family: inherit;
    font-weight: 600;
    color: var(--text-secondary);
}

.ref-table tr:hover td { background: var(--surface-2); }

.ref-table .copy-cell {
    text-align: right;
    width: 80px;
}

/* ===== 批量转换 ===== */
.batch-area {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 32px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.batch-textarea {
    width: 100%;
    min-height: 120px;
    padding: 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-family: "SF Mono", Monaco, Consolas, monospace;
    font-size: 0.95rem;
    resize: vertical;
    outline: none;
    margin-bottom: 16px;
}

.batch-textarea:focus { border-color: var(--primary); }

.batch-textarea::placeholder { color: var(--text-muted); opacity: 0.6; }

.batch-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* ===== 格式说明 ===== */
.format-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.format-card {
    padding: 24px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s;
}

.format-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.format-card h3 {
    font-size: 1.05rem;
    margin-bottom: 12px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.format-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.format-card code {
    display: inline-block;
    padding: 2px 8px;
    background: var(--surface-2);
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--primary);
    margin: 2px 0;
}

/* ===== FAQ ===== */
.faq-section {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.faq-item {
    border-bottom: 1px solid var(--border);
    padding: 24px 0;
}

.faq-item:last-child { border-bottom: none; padding-bottom: 0; }
.faq-item:first-child { padding-top: 0; }

.faq-question {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color 0.2s;
    padding: 4px 0;
    gap: 16px;
}

.faq-question:hover { color: var(--primary); }

.faq-toggle {
    width: 32px; height: 32px;
    background: var(--surface-2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.2rem;
    font-weight: 300;
    transition: all 0.3s;
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.faq-item.active .faq-toggle {
    background: var(--primary);
    color: white;
    transform: rotate(45deg);
}

.faq-answer {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.8;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 500px;
    padding-top: 16px;
}

.faq-answer code {
    background: var(--surface-2);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: monospace;
    color: var(--primary);
}

/* ===== 面包屑 ===== */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb a:hover { color: var(--primary); }

.breadcrumb-sep { color: var(--border); }

/* ===== 页脚 ===== */
footer {
    text-align: center;
    padding: 48px 0 32px;
    color: var(--text-muted);
    font-size: 0.875rem;
    border-top: 1px solid var(--border);
    margin-top: 32px;
}

footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

footer a:hover { text-decoration: underline; }

.footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

/* ===== 回到顶部 ===== */
.back-to-top {
    position: fixed;
    bottom: 32px; right: 32px;
    width: 48px; height: 48px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    box-shadow: var(--shadow-lg);
    z-index: 99;
}

.back-to-top.visible { opacity: 1; visibility: visible; }

.back-to-top:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-4px);
}

/* 提示框 */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--text);
    color: white;
    padding: 12px 24px;
    border-radius: 100px;
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 200;
    box-shadow: var(--shadow-lg);
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* 响应式 */
@media (max-width: 768px) {
    header { padding: 110px 0 80px; }
    .hero-card { padding: 24px 20px; }
    .faq-section { padding: 28px 20px; }
    .batch-area { padding: 24px 20px; }
    .result-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
