/* ============================================
   秒融工具箱 - 全局样式
   清爽亮色风格
   ============================================ */

:root {
    --primary: #2196F3;
    --primary-hover: #1976D2;
    --primary-light: #E3F2FD;
    --accent: #26C6DA;
    --success: #66BB6A;
    --warning: #FFA726;
    --error: #EF5350;
    --bg: #F5F7FA;
    --card-bg: #FFFFFF;
    --text: #2D3436;
    --text-secondary: #636E72;
    --text-light: #B2BEC3;
    --border: #E0E6ED;
    --border-hover: #B0BEC5;
    --radius: 8px;
    --radius-lg: 12px;
    --max-width: 800px;
    --wide-max-width: 1120px;
    --sidebar-width: 280px;
    --shadow: 0 1px 3px rgba(0,0,0,0.06);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-hover);
}

/* ---- Layout ---- */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Layout with outer sidebars — 3-column symmetric grid keeps main content centered */
.page-wrapper {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, var(--max-width)) minmax(0, 1fr);
    gap: 0 24px;
    padding: 0 20px;
    max-width: calc(var(--max-width) + var(--sidebar-width) * 2 + 72px);
    margin: 0 auto;
}

.sidebar {
    position: sticky;
    top: 80px;
    align-self: start;
    width: var(--sidebar-width);
    justify-self: center;
    padding-top: 48px;
}

.sidebar--left {
    justify-self: end;
}

.sidebar .ad-slot {
    margin: 0;
}

.page-wrapper > .container {
    padding: 0;
}

/* ---- Header ---- */
.site-header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

.site-logo svg {
    width: 32px;
    height: 32px;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 14px;
}

.header-nav a {
    color: var(--text-secondary);
}

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

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dark-mode-toggle {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card-bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

/* ---- Ad Slots ---- */
.header-ads {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 100%;
    overflow: hidden;
}

.header-ads .ad-slot {
    margin: 10px 0;
}

.ad-slot {
    text-align: center;
    margin: 20px 0;
    min-height: 0;
    max-width: 100%;
    overflow: hidden;
}

.ad-slot:empty {
    display: none;
}

.sidebar .ad-slot + .ad-slot {
    margin-top: 16px;
}

.ad-label {
    display: inline-block;
    font-size: 11px;
    color: var(--text-light);
    border: 1px solid var(--border);
    padding: 1px 6px;
    border-radius: 3px;
    margin-bottom: 6px;
}

/* ---- Hero ---- */
.hero {
    text-align: center;
    padding: 48px 0 24px;
}

.hero h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text);
}

.hero p {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto;
}

.hero .privacy-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    padding: 6px 14px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

/* ---- Dropzone ---- */
.dropzone {
    border: 2px dashed var(--border-hover);
    border-radius: var(--radius-lg);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--card-bg);
    position: relative;
    user-select: none;
    -webkit-user-select: none;
}

.dropzone:hover,
.dropzone.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.dropzone-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.6;
}

.dropzone-text {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.dropzone-hint {
    font-size: 13px;
    color: var(--text-light);
}

.dropzone input[type="file"] {
    display: none;
}

.dropzone-label {
    display: block;
    cursor: pointer;
}

.file-count-badge {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 13px;
    margin-top: 12px;
}

/* ---- Options Bar ---- */
.options-bar {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.option-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.option-label {
    font-size: 14px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.format-pills {
    display: flex;
    gap: 8px;
}

.format-pill {
    padding: 8px 20px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--card-bg);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.15s;
}

.format-pill:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.format-pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Quality Slider */
.quality-slider {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 180px;
}

.quality-slider input[type="range"] {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border);
    border-radius: 2px;
    outline: none;
}

.quality-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
}

.quality-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    min-width: 36px;
    text-align: right;
}

/* Convert Button */
.btn-convert {
    padding: 10px 32px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

.btn-convert:hover {
    background: var(--primary-hover);
}

.btn-convert:disabled {
    background: var(--text-light);
    cursor: not-allowed;
}

/* ---- File List ---- */
.file-list {
    margin-top: 20px;
}

.file-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.file-list-header h3 {
    font-size: 15px;
    font-weight: 600;
}

.file-list-actions {
    display: flex;
    gap: 10px;
}

.btn-small {
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card-bg);
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    transition: all 0.15s;
}

.btn-small:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-small.primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.btn-small.primary:hover {
    background: var(--primary-hover);
}

/* Progress Bar */
.progress-bar {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin-bottom: 12px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    transition: width 0.3s;
    width: 0%;
}

.progress-text {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-align: center;
}

/* File Item */
.file-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
    gap: 12px;
}

.file-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    flex-shrink: 0;
}

.file-item-info {
    flex: 1;
    min-width: 0;
}

.file-item-name {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-item-size {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 2px;
}

.file-item-status {
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.file-item-status.pending {
    background: #FFF3E0;
    color: var(--warning);
}

.file-item-status.done {
    background: #E8F5E9;
    color: var(--success);
}

.file-item-status.error {
    background: #FFEBEE;
    color: var(--error);
}

.file-item-download {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card-bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.15s;
    flex-shrink: 0;
}

.file-item-download:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ---- SEO Content ---- */
.seo-content {
    margin-top: 48px;
    padding: 32px 0;
    border-top: 1px solid var(--border);
}

.seo-content h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 32px 0 12px;
    color: var(--text);
}

.seo-content h2:first-child {
    margin-top: 0;
}

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

.seo-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
}

.seo-content th,
.seo-content td {
    padding: 10px 14px;
    border: 1px solid var(--border);
    text-align: left;
}

.seo-content th {
    background: var(--bg);
    font-weight: 600;
}

.faq-item {
    margin-bottom: 20px;
}

.faq-item h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}

.faq-item p {
    font-size: 14px;
}

/* ---- Footer ---- */
.site-footer {
    margin-top: 48px;
    padding: 24px 0;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 13px;
    color: var(--text-light);
}

.site-footer a {
    color: var(--text-secondary);
    margin: 0 10px;
}

.site-footer a:hover {
    color: var(--primary);
}

/* ---- Responsive ---- */
@media (max-width: 1200px) {
    .sidebar--left {
        display: none;
    }
    .page-wrapper {
        grid-template-columns: minmax(0, var(--max-width)) minmax(0, 1fr);
    }
}

@media (max-width: 1000px) {
    .page-wrapper {
        display: block;
        padding: 0 20px;
    }

    .sidebar {
        display: none;
    }
}

@media (max-width: 640px) {
    .hero h1 {
        font-size: 22px;
    }

    .hero p {
        font-size: 14px;
    }

    .dropzone {
        padding: 32px 16px;
    }

    .options-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .format-pills {
        flex-wrap: wrap;
    }

    .btn-convert {
        width: 100%;
        text-align: center;
    }

    .file-item {
        flex-wrap: wrap;
    }

    .file-list-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .site-header .container {
        flex-direction: column;
        gap: 8px;
    }
}

/* ---- Language Switcher ---- */
.lang-switch {
    padding: 4px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.15s;
    margin-left: 4px;
}

.lang-switch:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ---- Breadcrumb ---- */
.breadcrumb {
    padding: 10px 0;
    font-size: 13px;
    color: var(--text-light);
}
.breadcrumb .container {
    display: flex;
    align-items: center;
    gap: 6px;
}
.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
}
.breadcrumb a:hover {
    color: var(--primary);
}
.bc-sep {
    color: var(--text-light);
    font-size: 14px;
}
.bc-current {
    color: var(--text);
    font-weight: 500;
}

/* ---- Related Tools ---- */
.related-tools {
    margin: 32px 0 16px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}
.related-tools-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}
.related-tools-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.related-tool-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: all 0.15s;
}
.related-tool-card:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(33,150,243,0.08);
}
.related-tool-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.related-tool-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}
.related-tool-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
@media (max-width: 640px) {
    .related-tools-grid { grid-template-columns: 1fr; }
}

/* ---- Home Search Bar ---- */
.home-search {
    max-width: 460px;
    margin: 0 auto 8px;
    position: relative;
}
.home-search-input {
    width: 100%;
    padding: 10px 44px 10px 40px;
    border: 1px solid var(--border);
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    background: var(--card-bg);
    color: var(--text);
    transition: border-color 0.15s;
}
.home-search-input:focus {
    border-color: var(--primary);
}
.home-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
}
.home-search-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    flex-shrink: 0;
}
.home-search-btn:hover {
    background: var(--primary-hover);
}

/* ---- Category Tabs ---- */
.cat-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: 12px 0 20px;
}
.cat-tab {
    padding: 5px 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--card-bg);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.cat-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.cat-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
@media (max-width: 640px) {
    .cat-tabs { gap: 6px; }
    .cat-tab { padding: 4px 10px; font-size: 12px; }
}

/* ---- Recently Used ---- */
.recently-used {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.recently-used-label {
    font-size: 12px;
    color: var(--text-light);
    line-height: 30px;
    flex-shrink: 0;
}
.recent-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    font-size: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    background: var(--card-bg);
    transition: all 0.15s;
}
.recent-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ---- Dark Mode ---- */
.dark-mode-toggle {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card-bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.15s;
    margin-left: 4px;
    color: var(--text-secondary);
    flex-shrink: 0;
}
.dark-mode-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
}
[data-theme="dark"] {
    --bg: #1a1d23;
    --card-bg: #242830;
    --text: #e4e7eb;
    --text-secondary: #9ba3ae;
    --text-light: #6b7280;
    --border: #353a44;
    --border-hover: #4b5260;
    --primary-light: #1e3a5f;
    --shadow: 0 1px 3px rgba(0,0,0,0.2);
}
[data-theme="dark"] .site-header {
    background: #242830;
    border-bottom-color: #353a44;
}
[data-theme="dark"] .site-footer {
    border-top-color: #353a44;
}
[data-theme="dark"] .ad-slot {
    background: #1e2128;
    border-color: #353a44;
}
[data-theme="dark"] .seo-content table th {
    background: #1e2128;
}
[data-theme="dark"] .seo-content table td {
    border-bottom-color: #353a44;
}
[data-theme="dark"] .hero,
[data-theme="dark"] .dropzone {
    border-color: #353a44;
    background: #242830;
}
[data-theme="dark"] .tool-card {
    background: #242830;
    border-color: #353a44;
}
[data-theme="dark"] .tool-card:hover {
    border-color: var(--primary);
}
[data-theme="dark"] .more-modal-box,
[data-theme="dark"] .more-card,
[data-theme="dark"] .more-search {
    background: #242830;
    border-color: #353a44;
    color: var(--text);
}

/* ---- Mobile Nav Menu ---- */
.mobile-menu-btn {
    display: none;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card-bg);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-secondary);
}
@media (max-width: 640px) {
    .mobile-menu-btn { display: flex; }
    .header-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--card-bg);
        border-top: 1px solid var(--border);
        padding: 12px 20px;
        gap: 4px;
        z-index: 200;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        flex-direction: column;
    }
    .header-nav.open { display: flex; }
    .header-nav a {
        padding: 10px 0;
        font-size: 15px;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    .site-header .container {
        position: relative;
    }
    .cat-tabs { gap: 6px; flex-wrap: wrap; }
    .cat-tab { padding: 6px 12px; font-size: 12px; min-height: 32px; }
    /* 广告自适应 */
    .ad-slot { max-width: 100%; overflow: hidden; }
    .ad-slot img, .ad-slot iframe, .ad-slot ins, .ad-slot div[style] {
        max-width: 100% !important;
        height: auto !important;
    }
    .sidebar .ad-slot { display: none; }
    /* 最近使用 - 手机端重新排版 */
    .recently-used {
        justify-content: flex-start;
        gap: 6px;
        margin-bottom: 12px;
        padding: 0 2px;
    }
    .recently-used-label {
        width: 100%;
        line-height: 1.4;
        font-size: 12px;
        margin-bottom: 2px;
    }
    .recent-chip {
        padding: 3px 10px;
        font-size: 11px;
        border-radius: 14px;
    }
    .home-search-btn {
        width: 36px;
        height: 36px;
        right: 3px;
    }
}
