/* ========================================
   ZIP to PDF — 响应式设计
   使用 CSS 变量 (var(--xxx)) 引用设计系统
   ======================================== */

/* ---- 导航栏 ---- */
@media (max-width: 768px) {
    .top-header {
        flex-direction: row;
        align-items: center;
        height: auto;
        padding: 10px 12px;
    }
    .logo img { height: 36px; }
    .user-menu .nav-link {
        padding: 5px 10px;
        font-size: 0.82em;
    }
    .main-navigation {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .nav-list { gap: 0; }
    .nav-item .nav-link {
        padding: 10px 14px;
        font-size: 0.85em;
    }
}

/* ---- 管理后台导航 ---- */
@media (max-width: 768px) {
    .admin-nav { flex-wrap: wrap; gap: 4px; }
    .admin-nav a { padding: 8px 14px; font-size: 0.85em; }
    .admin-box { padding: 16px; }
}

/* ---- 侧边栏 ---- */
@media (max-width: 900px) {
    .layout-container { flex-direction: column; }
    .content-wrapper { margin-right: 0; }
}

/* ---- 容器/内容 ---- */
@media (max-width: 768px) {
    .container { max-width: 100%; padding: 0; }
    .content {
        padding: 16px;
        margin: 0 0 12px 0;
        border-radius: var(--radius-lg);
    }
    .tool-card {
        padding: 18px;
        border-radius: var(--radius-lg);
    }
    .page-header {
        padding: 0 2px var(--space-4);
        gap: var(--space-3);
    }
    .page-header-icon {
        width: 48px;
        height: 48px;
        border-radius: 15px;
    }
    .page-header-svg {
        width: 23px;
        height: 23px;
    }
    .page-header h1 { font-size: 1.3em; }
}

/* ---- 文件/PDF 列表 ---- */
@media (max-width: 768px) {
    .file-item { flex-direction: column; align-items: flex-start; gap: 8px; }
    .pdf-item { flex-direction: column; align-items: flex-start; gap: 8px; }
    .upload-area, .upload-zone { padding: 32px 20px; }
    .upload-icon {
        width: 60px;
        height: 60px;
        border-radius: 18px;
        font-size: 2.1em;
    }
    .upload-icon-svg { width: 28px; height: 28px; }
}

/* ---- 博客 ---- */
@media (max-width: 768px) {
    .blog-content { padding: 14px; margin: 0; max-width: 100%; }
    .post-title { font-size: 1.4em; }
    .post-body { font-size: 0.92em; }
    .post-body pre { padding: 10px; font-size: 0.82em; overflow-x: auto; }
    .per-page-bar { flex-wrap: wrap; row-gap: 8px; padding: 10px 12px; }
    .per-page-label, .per-page-link, .per-page-divider,
    .excerpt-toggle, .per-page-total { flex-shrink: 0; white-space: nowrap; }
}

/* ---- 表格 ---- */
@media (max-width: 768px) {
    .posts-table, .users-table, .logs-table, .files-table, .file-table,
    .posts-table thead, .users-table thead, .logs-table thead,
    .posts-table tbody, .users-table tbody, .logs-table tbody,
    .posts-table th, .users-table th, .logs-table th,
    .posts-table td, .users-table td, .logs-table td,
    .posts-table tr, .users-table tr, .logs-table tr {
        font-size: 0.85em;
    }
    .posts-table th, .posts-table td,
    .users-table th, .users-table td,
    .logs-table th, .logs-table td {
        padding: 6px 8px;
    }
    .cat-table { min-width: 720px; }
}

/* ---- 统计面板 ---- */
@media (max-width: 768px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat-card { padding: 14px; }
    .stat-card .number { font-size: 1.4em; }
}

/* ---- 分步指示器 ---- */
@media (max-width: 768px) {
    .step-indicator { flex-wrap: wrap; gap: 8px; }
    .step { flex: 1; min-width: 60px; }
    .step-label { font-size: 0.7em; }
}

/* ---- 表单 ---- */
@media (max-width: 768px) {
    .form-group { margin-bottom: 14px; }
    .format-select { max-width: 100%; }
    .tool-section { padding: 14px 16px; }
    .tool-title { font-size: 1em; }
}

/* ---- 通用 ---- */
@media (max-width: 768px) {
    .footer { padding: 14px; font-size: 0.82em; }
    .page-header p { font-size: 0.85em; }

    /* 按钮 */
    .upload-btn, .download-btn, .tool-btn, .btn { padding: 7px 16px; font-size: 0.88em; }

    /* 分页 */
    .pagination { gap: 2px; }
    .pagination a, .pagination span { padding: 5px 10px; font-size: 0.82em; }
}

/* ---- 超小屏幕 ---- */
@media (max-width: 480px) {
    .top-header { padding: 6px 8px; }
    .logo img { height: 30px; }
    .nav-item .nav-link { padding: 8px 10px; font-size: 0.8em; }
    .page-header h1 { font-size: 1.15em; }
    .post-title { font-size: 1.2em; }
    .post-body { font-size: 0.88em; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .stat-card .number { font-size: 1.2em; }
    .admin-box { padding: 12px; }

    /* 面包屑 */
    .breadcrumb { font-size: 0.78em; }

    /* 侧边栏 - 更紧凑 */
    .sidebar-section { margin-bottom: 12px; }
    .sidebar-section h3 { font-size: 0.9em; }
    .sidebar-section a { font-size: 0.82em; }
}

/* ---- 滚动条 ---- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.16); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ---- 触摸优化 ---- */
button, a { -webkit-tap-highlight-color: transparent; }

/* ---- 焦点样式（按钮/链接的环形高亮由 style.css 统一处理） ---- */
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

/* ---- 文本溢出 ---- */
.file-name, .post-title, .tool-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}