/* ========================================
   而立云盘 - 全局样式
   ======================================== */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

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

/* ===== 头部 ===== */
.site-header {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo h1, .logo a {
    font-size: 22px;
    font-weight: 700;
    color: #4CAF50;
    text-decoration: none;
}

.logo img {
    max-height: 40px;
    vertical-align: middle;
}

.nav {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav a {
    text-decoration: none;
    color: #555;
    padding: 6px 12px;
    border-radius: 6px;
    transition: 0.2s;
    font-size: 14px;
}

.nav a:hover { background: #f0f0f0; }
.nav a.active { color: #4CAF50; font-weight: 600; }

/* ===== Hero ===== */
.hero {
    text-align: center;
    padding: 40px 0 30px;
}

.hero h2 { font-size: 28px; color: #222; }
.hero p { color: #666; margin-top: 8px; font-size: 16px; }

.stats {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    align-items: center;
}

.stats span {
    background: #fff;
    padding: 6px 18px;
    border-radius: 20px;
    border: 1px solid #e9ecef;
    font-size: 14px;
    color: #555;
}

.btn-submit {
    background: #4CAF50;
    color: #fff !important;
    padding: 8px 24px;
    border-radius: 24px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: 0.3s;
}
.btn-submit:hover { background: #388E3C; transform: scale(1.02); }

/* ===== 筛选栏 ===== */
.filter-bar {
    background: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    margin: 0 0 24px 0;
}

.filter-bar form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.filter-bar input,
.filter-bar select {
    padding: 8px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    min-width: 140px;
    flex: 1;
}

.filter-bar input:focus,
.filter-bar select:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76,175,80,0.15);
}

.filter-bar button {
    padding: 8px 24px;
    background: #4CAF50;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: 0.2s;
}
.filter-bar button:hover { background: #388E3C; }

/* ===== 文件网格 ===== */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin: 16px 0 24px;
}

.file-card {
    background: #fff;
    border-radius: 10px;
    padding: 14px 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    border: 1px solid #f0f0f0;
    transition: 0.25s;
    display: flex;
    flex-direction: column;
    position: relative;
}

.file-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    border-color: #e0e0e0;
}

.file-icon { font-size: 36px; text-align: center; line-height: 1.2; margin-bottom: 2px; }
.file-title {
    font-size: 15px;
    font-weight: 600;
    margin: 2px 0;
    text-align: center;
    cursor: help;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== 资源图标 ===== */
.file-icon .resource-icon {
    width: auto;
    height: auto;
    max-width: 64px;
    max-height: 64px;
    border-radius: 8px;
    object-fit: contain;
    display: inline-block;
}
.file-icon .resource-emoji {
    font-size: 64px;
    line-height: 1.2;
    display: inline-block;
}

.file-grid .file-icon .resource-icon {
    max-width: 64px;
    max-height: 64px;
    border-radius: 8px;
    object-fit: contain;
}
.file-grid .file-icon .resource-emoji {
    font-size: 64px;
}

.file-list .file-icon .resource-icon {
    max-width: 20px;
    max-height: 20px;
    border-radius: 4px;
    object-fit: contain;
}
.file-list .file-icon .resource-emoji {
    font-size: 20px;
}

/* 移动端适配 */
@media (max-width: 575px) {
    .file-grid .file-icon .resource-icon {
        max-width: 40px;
        max-height: 40px;
        border-radius: 6px;
    }
    .file-grid .file-icon .resource-emoji {
        font-size: 40px;
    }
}
.file-meta { font-size: 13px; color: #888; margin: 2px 0; display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.file-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0 10px; justify-content: center; }

.tag {
    background: #f0f0f0;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    color: #666;
}
.tag.invalid { background: #fce4ec; color: #c62828; }

.file-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #f5f5f5;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    text-decoration: none;
    display: inline-block;
    transition: 0.2s;
    text-align: center;
    flex: 1;
    min-width: 60px;
}

.btn-download {
    background: #4CAF50;
    color: #fff;
}
.btn-download:hover { background: #388E3C; }

.btn-preview {
    background: #2196F3;
    color: #fff;
}
.btn-preview:hover { background: #1976D2; }

.btn-share {
    background: #FF9800;
    color: #fff;
}
.btn-share:hover { background: #E68900; }

.file-footer {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #bbb;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #f5f5f5;
}

/* ===== 空状态 ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    grid-column: 1 / -1;
}
.empty-state a { color: #4CAF50; text-decoration: none; }

/* ===== 分页 ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.pagination a {
    padding: 6px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-decoration: none;
    color: #555;
    transition: 0.2s;
    font-size: 14px;
}
.pagination a:hover { background: #f0f0f0; }
.pagination a.active {
    background: #4CAF50;
    color: #fff;
    border-color: #4CAF50;
}

/* ===== 页脚 ===== */
.site-footer {
    text-align: center;
    padding: 30px 0 20px;
    border-top: 1px solid #eee;
    margin-top: 20px;
    color: #999;
    font-size: 13px;
}
.site-footer a { color: #4CAF50; text-decoration: none; }

/* ===== 提交页面 ===== */
.submit-container {
    max-width: 700px;
    margin: 30px auto;
    background: #fff;
    padding: 30px 35px;
    border-radius: 12px;
    box-shadow: 0 1px 8px rgba(0,0,0,0.06);
}

.submit-container h2 { text-align: center; margin-bottom: 5px; }
.submit-desc { text-align: center; color: #888; margin-bottom: 25px; font-size: 14px; }

.submit-form .form-group { margin-bottom: 18px; }
.submit-form label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 14px; }
.submit-form .required { color: #f44336; }
.submit-form input,
.submit-form select,
.submit-form textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: 0.2s;
}
.submit-form input:focus,
.submit-form select:focus,
.submit-form textarea:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76,175,80,0.12);
}
.submit-form textarea { resize: vertical; font-family: inherit; }
.submit-form small { color: #999; font-size: 12px; display: block; margin-top: 3px; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.tag-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 4px;
}
.tag-checkboxes label {
    font-weight: normal;
    font-size: 14px;
    cursor: pointer;
}
.tag-checkboxes input[type="checkbox"] { width: auto; margin-right: 4px; }

.email-verify-group {
    display: flex;
    gap: 10px;
}
.email-verify-group input { flex: 1; }
.btn-send-code {
    padding: 10px 20px;
    background: #2196F3;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    font-size: 14px;
}
.btn-send-code:hover { background: #1976D2; }
.btn-send-code:disabled { opacity: 0.6; cursor: not-allowed; }

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}
.btn-submit-form {
    flex: 1;
    padding: 12px;
    background: #4CAF50;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: 0.2s;
}
.btn-submit-form:hover { background: #388E3C; }
.btn-cancel {
    padding: 12px 30px;
    background: #eee;
    color: #555;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    text-align: center;
    font-size: 16px;
}
.btn-cancel:hover { background: #ddd; }

.result-success {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 15px 20px;
    border-radius: 6px;
    margin-top: 20px;
    text-align: center;
    font-size: 16px;
}
.result-error {
    background: #fce4ec;
    color: #c62828;
    padding: 15px 20px;
    border-radius: 6px;
    margin-top: 20px;
    text-align: center;
    font-size: 16px;
}

/* ===== 分享弹窗 ===== */
.share-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.share-modal-overlay.active { display: flex; }

.share-modal-box {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    position: relative;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.share-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}
.share-modal-close:hover { color: #333; }

/* ===== 网盘相关样式 ===== */
.file-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 6px 0;
}

.cloud-badge {
    display: inline-block;
    background: #e3f2fd;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    color: #1565c0;
}

.pwd-badge {
    display: inline-block;
    background: #fff3e0;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    color: #e65100;
}

.pwd-badge .copy-pwd-btn {
    background: none;
    border: none;
    color: #1976D2;
    cursor: pointer;
    font-size: 10px;
    margin-left: 2px;
    padding: 0 4px;
}

.pwd-badge .copy-pwd-btn:hover {
    text-decoration: underline;
}

.file-id-badge {
    display: inline-block;
    background: #f5f5f5;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    color: #666;
}

.cloud-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    background: #e3f2fd;
    color: #1565c0;
}

.pwd-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    background: #fff3e0;
    color: #e65100;
}

.cloud-preview-result {
    background: #f5f5f5;
    padding: 8px 14px;
    border-radius: 4px;
    font-size: 13px;
    color: #555;
    margin-top: 5px;
}

.cloud-preview-result code {
    background: #fff;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 12px;
    color: #1976D2;
}

/* ========================================
   列表模式 - 软件名称悬停提示
   ======================================== */

/* 列表模式下的软件名称 - 悬停显示描述 */
.file-list .file-title {
    cursor: help;
    border-bottom: 1px dashed #ddd;
    padding-bottom: 1px;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: border-color 0.2s;
}

.file-list .file-title:hover {
    border-bottom-color: #4CAF50;
}

/* 自定义 Tooltip 气泡（覆盖浏览器默认） */
.file-list .file-title[title]:hover::after {
    content: attr(title);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(100% + 10px);
    background: rgba(0, 0, 0, 0.88);
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    max-width: 300px;
    white-space: normal;
    word-wrap: break-word;
    z-index: 1000;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    line-height: 1.6;
    text-align: left;
    font-weight: 400;
    pointer-events: none;
    animation: tooltipFadeIn 0.25s ease;
}

.file-list .file-title[title]:hover::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(100% + 4px);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.88);
    z-index: 1000;
    pointer-events: none;
}

/* 卡片需要相对定位 */
.file-list .file-card {
    position: relative;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ========================================
   文件卡片网格模式 - 悬停提示
   ======================================== */

.file-grid .file-title[title]:hover::after {
    content: attr(title);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(100% + 8px);
    background: rgba(0, 0, 0, 0.88);
    color: #fff;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 12px;
    max-width: 260px;
    white-space: normal;
    word-wrap: break-word;
    z-index: 100;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    line-height: 1.5;
    text-align: center;
    font-weight: 400;
    pointer-events: none;
    animation: tooltipFadeIn 0.2s ease;
}

.file-grid .file-title[title]:hover::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(100% + 2px);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.88);
    z-index: 100;
    pointer-events: none;
}

/* ========================================
   响应式设计 - 全面优化 v2.0
   ======================================== */

/* ---- 超大屏幕 (≥1400px) ---- */
@media (min-width: 1400px) {
    .container { max-width: 1320px; }
    .file-grid { grid-template-columns: repeat(5, 1fr); gap: 24px; }
    .file-grid .file-card { padding: 20px 18px; }
    .file-grid .file-title { font-size: 16px; }
}

/* ---- 大屏幕 (1200-1399px) ---- */
@media (min-width: 1200px) and (max-width: 1399px) {
    .file-grid { grid-template-columns: repeat(4, 1fr); gap: 20px; }
    .file-grid .file-card { padding: 16px; }
}

/* ---- 中等屏幕 (992-1199px) ---- */
@media (min-width: 992px) and (max-width: 1199px) {
    .file-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
    .file-grid .file-title { font-size: 14px; }
    .file-grid .file-card { padding: 14px; }
}

/* ---- 平板横屏 (768-991px) ---- */
@media (min-width: 768px) and (max-width: 991px) {
    .file-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
    .file-grid .file-card { padding: 12px; }
    .file-grid .file-title { font-size: 13px; }
    .file-grid .file-icon { font-size: 30px; }
    .file-grid .file-actions .btn { font-size: 11px; padding: 4px 10px; min-height: 32px; }
    .file-grid .file-meta { font-size: 12px; }
    .file-grid .cloud-badge { font-size: 10px; }
    
    .filter-bar form { flex-wrap: wrap; }
    .filter-bar input, .filter-bar select { min-width: 120px; flex: 1 1 45%; }
    .filter-bar button { padding: 8px 18px; }
    
    .nav-tabs a { font-size: 12px; padding: 3px 10px; }
}

/* ---- 平板竖屏 / 大手机 (576-767px) ---- */
@media (min-width: 576px) and (max-width: 767px) {
    .file-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .file-grid .file-card { padding: 10px 8px; }
    .file-grid .file-title { font-size: 13px; }
    .file-grid .file-icon { font-size: 28px; }
    .file-grid .file-meta { font-size: 11px; gap: 4px; flex-wrap: wrap; justify-content: center; }
    .file-grid .file-actions .btn { font-size: 10px; padding: 3px 8px; min-height: 30px; }
    .file-grid .tag { font-size: 9px; padding: 1px 6px; }
    .file-grid .cloud-badge { font-size: 9px; padding: 0 6px; }
    
    .file-list { display: none !important; }
    .list-header { display: none !important; }
    .file-grid { display: grid !important; }
    
    .toolbar { flex-direction: column; align-items: stretch; }
    .toolbar-left, .toolbar-right { width: 100%; justify-content: center; flex-wrap: wrap; }
    .toolbar-search input { width: 100%; }
    .toolbar-search { width: 100%; }
    .toolbar-search button { flex: 1; }
    
    .stats { gap: 8px; flex-wrap: wrap; }
    .stats span { font-size: 12px; padding: 4px 12px; }
    
    .pagination a { font-size: 12px; padding: 4px 10px; min-height: 32px; }
    
    .share-modal-box { padding: 20px; }
    .report-modal-box { padding: 20px; }
}

/* ---- 小手机 (<576px) ---- */
@media (max-width: 575px) {
    .container { padding: 0 8px; }
    
    .file-grid { 
        grid-template-columns: 1fr 1fr; 
        gap: 8px; 
        margin: 10px 0 16px;
    }
    .file-grid .file-card { 
        padding: 8px 6px; 
        border-radius: 6px; 
        box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    }
    .file-grid .file-icon { 
        font-size: 24px; 
        margin-bottom: 0 !important;
        line-height: 1.2;
    }
    .file-grid .file-title { 
        font-size: 12px !important; 
        margin: 1px 0 !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        text-align: center;
    }
    .file-grid .file-title span { 
        font-size: 9px !important; 
    }
    .file-grid .file-meta { 
        font-size: 9px; 
        gap: 3px; 
        flex-wrap: wrap; 
        justify-content: center;
    }
    .file-grid .file-meta .file-size { font-size: 9px; }
    .file-grid .file-meta .file-date { font-size: 8px; }
    .file-grid .cloud-badge { 
        font-size: 8px !important; 
        padding: 0 4px; 
        border-radius: 8px;
    }
    .file-grid .file-tags { 
        gap: 2px; 
        margin: 2px 0 !important; 
        justify-content: center;
    }
    .file-grid .file-tags .tag { 
        font-size: 7px; 
        padding: 0 4px; 
        border-radius: 6px;
        line-height: 1.6;
    }
    .file-grid .file-actions { 
        gap: 3px; 
        padding-top: 4px; 
        justify-content: center;
        flex-wrap: wrap;
    }
    .file-grid .file-actions .btn { 
        font-size: 8px; 
        padding: 2px 6px; 
        min-height: 26px;
        flex: 0 1 auto;
        border-radius: 3px;
    }
    .file-grid .file-actions .btn-report { 
        font-size: 7px; 
        padding: 2px 4px; 
        min-height: 22px;
    }
    .file-grid .email-icon { font-size: 11px; }
    
    .file-list { display: none !important; }
    .list-header { display: none !important; }
    .file-grid { display: grid !important; }
    
    .header-inner { flex-wrap: wrap; gap: 4px; padding: 4px 0; }
    .logo h1, .logo a { font-size: 16px; }
    .logo img { max-height: 28px; }
    .nav { gap: 2px; }
    .nav a { 
        font-size: 11px; 
        padding: 3px 8px; 
        background: #f5f5f5;
        border-radius: 14px;
    }
    .nav a.active { background: #4CAF50; color: #fff; }
    .nav a:hover { background: #e0e0e0; }
    
    .filter-bar { padding: 8px; margin: 0 0 12px 0; }
    .filter-bar form { flex-direction: column; gap: 4px; }
    .filter-bar input, .filter-bar select { 
        min-width: 100%; 
        font-size: 11px; 
        padding: 5px 8px; 
        height: 32px;
    }
    .filter-bar button { 
        width: 100%; 
        font-size: 11px; 
        padding: 5px; 
        height: 32px;
    }
    
    .hero { padding: 16px 0 12px; }
    .hero h2 { font-size: 16px; margin-bottom: 4px; }
    .hero p { font-size: 12px; margin-top: 2px; }
    .stats { gap: 4px; }
    .stats span { 
        font-size: 10px; 
        padding: 2px 8px; 
        border-radius: 12px;
    }
    .btn-submit { 
        font-size: 11px; 
        padding: 3px 12px; 
        border-radius: 16px;
    }
    
    .nav-container { padding: 6px 8px; margin: 6px 0; }
    .nav-tabs { gap: 2px; padding-bottom: 4px; }
    .nav-tabs a { 
        font-size: 10px; 
        padding: 2px 6px; 
        border-radius: 10px;
    }
    .nav-tabs a .count { font-size: 8px; }
    .nav-switch { font-size: 11px; gap: 6px; }
    .breadcrumb { font-size: 10px; }
    
    .pagination { gap: 3px; margin: 12px 0; }
    .pagination a { 
        font-size: 10px; 
        padding: 2px 6px; 
        min-height: 26px;
        border-radius: 3px;
    }
    
    .site-footer { 
        font-size: 10px; 
        padding: 12px 0 8px; 
        margin-top: 8px;
    }
    .site-footer p { margin: 2px 0; }
    .site-footer a { font-size: 10px; }
    
    .share-modal-box { padding: 14px; }
    .share-modal-box h3 { font-size: 15px; }
    .share-url-input { font-size: 11px; padding: 4px 8px; }
    .share-copy-btn { font-size: 12px; padding: 4px 12px; }
    .share-qrcode-img { max-width: 140px; }
    
    .report-modal-box { padding: 14px; }
    .report-modal-box h3 { font-size: 15px; }
    .report-modal-box label { font-size: 11px; }
    .report-modal-box input, 
    .report-modal-box select, 
    .report-modal-box textarea { 
        font-size: 11px; 
        padding: 4px 6px; 
        height: 30px;
    }
    .report-modal-box textarea { height: 60px; }
    .btn-report-submit { font-size: 13px; padding: 6px; }
    
    .popup-modal-box { padding: 16px; }
    .popup-modal-box h3 { font-size: 16px; }
    .popup-modal-box #popup-content { font-size: 12px; }
    .popup-link { font-size: 12px; padding: 4px 16px; }
    .popup-close-btn { font-size: 12px; padding: 4px 20px; }
}

/* ---- 超小手机 (<400px) - 单列 ---- */
@media (max-width: 399px) {
    .file-grid { grid-template-columns: 1fr; gap: 8px; }
    .file-grid .file-card { padding: 10px; }
    .file-grid .file-title { font-size: 14px !important; }
    .file-grid .file-icon { font-size: 32px; }
    .file-grid .file-actions .btn { 
        font-size: 10px; 
        padding: 4px 10px; 
        min-height: 34px;
    }
    .file-grid .file-actions .btn-report { min-height: 26px; }
}

/* ---- 触摸设备优化（所有触屏） ---- */
@media (hover: none) and (pointer: coarse) {
    .btn, .btn-submit, .btn-send-code, .btn-report, .btn-submit-form,
    .btn-approve, .btn-reject, .btn-edit, .btn-delete, .btn-share, .btn-check {
        min-height: 44px;
        min-width: 44px;
        padding: 8px 16px;
    }
    .file-actions .btn { min-height: 36px; }
    .file-grid .file-actions .btn { min-height: 34px; }
    .file-grid .file-actions .btn-report { min-height: 28px; }
    .nav a { padding: 8px 14px; }
    .pagination a { min-height: 36px; padding: 6px 12px; }
    input, select, textarea { font-size: 16px !important; }
}

/* ---- 打印样式 ---- */
@media print {
    .site-header, .filter-bar, .toolbar, .pagination, 
    .file-actions, .btn, .btn-report, .email-icon,
    .nav-container, .hero, .site-footer { display: none !important; }
    .file-card { break-inside: avoid; border: 1px solid #ddd; box-shadow: none; }
    .file-grid { gap: 10px; }
}

/* ===== 友情链接弹窗 ===== */
.friend-link-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9996;
    padding: 15px;
}
.friend-link-modal-overlay.active { display: flex; }
.friend-link-modal-box {
    background: #fff;
    padding: 24px 30px;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalIn 0.3s ease;
}
.friend-link-modal-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}
.friend-link-modal-close:hover { color: #333; }
.friend-link-modal-box .form-group { margin-bottom: 12px; }
.friend-link-modal-box label {
    display: block;
    font-weight: 600;
    margin-bottom: 3px;
    font-size: 13px;
}
.friend-link-modal-box input,
.friend-link-modal-box textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    box-sizing: border-box;
}
.friend-link-modal-box textarea { resize: vertical; font-family: inherit; }
.btn-friend-submit {
    width: 100%;
    padding: 10px;
    background: #4CAF50;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    cursor: pointer;
    transition: 0.2s;
}
.btn-friend-submit:hover { background: #388E3C; }
.btn-friend-submit:disabled { opacity: 0.6; cursor: not-allowed; }