/* ========== 基础设置 ========== */
:root {
    --bg: #f6f5f2;
    --card: #ffffff;
    --text: #2c2c2c;
    --text-light: #8a8a8a;
    --accent: #c4522a;
    --border: #e8e5e0;
    --hover: #faf8f5;
    --radius: 10px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    -webkit-tap-highlight-color: transparent;
}

/* ========== 顶部导航 ========== */
.topbar {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.logo {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.tagline {
    font-size: 13px;
    color: var(--text-light);
}

/* ========== 主容器 ========== */
.container {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 28px 20px;
}

/* ========== 三栏布局 ========== */
.layout {
    display: flex;
    gap: 20px;
    align-items: stretch;
}

.sidebar {
    width: 240px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.widget {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 16px 18px;
}

.widget-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

/* ========== 公告栏 ========== */
.notice-widget {
    flex: 1;
    min-height: 260px;
    display: flex;
    flex-direction: column;
}

.notice-list {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.notice-item {
    padding: 10px 0;
    border-bottom: 1px dashed var(--border);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.notice-item:last-child {
    border-bottom: none;
}

.notice-date {
    font-size: 11px;
    color: var(--accent);
    font-weight: 500;
}

.notice-text {
    font-size: 13px;
    color: var(--text);
    line-height: 1.5;
}

.notice-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 13px;
    text-align: center;
    padding: 20px 0;
}

/* ========== 右侧联系方式 ========== */
.contact-widget {
    min-height: 140px;
}

.time-widget {
    min-height: 100px;
}

.contact-list {
    display: flex;
    flex-direction: column;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    text-decoration: none;
    color: var(--text);
    border-bottom: 1px dashed var(--border);
    font-size: 13px;
    transition: color 0.15s ease;
}

.contact-item:last-child {
    border-bottom: none;
}

a.contact-item:hover {
    color: var(--accent);
}

a.contact-item:active {
    opacity: 0.7;
}

.contact-icon {
    font-size: 15px;
    flex-shrink: 0;
}

.contact-label {
    color: var(--text-light);
    flex-shrink: 0;
    min-width: 36px;
}

.contact-value {
    flex: 1;
    text-align: right;
    word-break: break-all;
}

.online-time {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.8;
}

/* ========== 文件面板 ========== */
.file-panel {
    flex: 1;
    min-width: 0;
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 420px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 22px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.panel-header h2 {
    font-size: 15px;
    font-weight: 600;
}

.file-count {
    font-size: 12px;
    color: var(--text-light);
    background: var(--bg);
    padding: 3px 10px;
    border-radius: 20px;
    flex-shrink: 0;
}

/* ========== 搜索框 ========== */
.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 14px 22px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    flex-shrink: 0;
}

.search-box:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(196, 82, 42, 0.08);
}

.search-icon {
    font-size: 14px;
    flex-shrink: 0;
    opacity: 0.6;
}

.search-box input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    color: var(--text);
    outline: none;
    font-family: inherit;
    min-width: 0;
}

.search-box input::placeholder {
    color: #b5b0a8;
}

.clear-btn {
    border: none;
    background: transparent;
    color: var(--text-light);
    font-size: 13px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    display: none;
    transition: color 0.15s ease, background 0.15s ease;
    flex-shrink: 0;
}

.clear-btn:hover {
    color: var(--text);
    background: var(--border);
}

.clear-btn.visible {
    display: block;
}

/* ========== 文件列表 ========== */
.file-list {
    flex: 1;
    overflow-y: auto;
    max-height: 500px;
}

.file-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 22px;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s ease;
}

.file-row:last-child {
    border-bottom: none;
}

.file-row:hover {
    background: var(--hover);
}

.file-row:active {
    background: var(--hover);
}

.file-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: #f3ede7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: default;
}

.file-name mark {
    background: #f7d9c8;
    color: var(--accent);
    padding: 0 1px;
    border-radius: 2px;
}

.file-meta {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 1px;
}

.download-btn {
    flex-shrink: 0;
    padding: 5px 14px;
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    border-radius: 6px;
    font-size: 12px;
    text-decoration: none;
    transition: all 0.15s ease;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.download-btn:hover {
    background: var(--accent);
    color: #fff;
}

.download-btn:active {
    background: var(--accent);
    color: #fff;
    opacity: 0.8;
}

/* ========== 空状态 ========== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
    font-size: 13px;
}

/* ========== 骨架屏 ========== */
.skeleton {
    pointer-events: none;
}

.skeleton-bar {
    height: 13px;
    border-radius: 4px;
    background: #ece9e4;
    animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ========== 底部 ========== */
.footer {
    text-align: center;
    padding: 16px;
    font-size: 12px;
    color: var(--text-light);
    border-top: 1px solid var(--border);
    background: var(--card);
}

/* ========== 验证码弹窗 ========== */
.captcha-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.captcha-modal.active {
    display: flex;
}

.captcha-box {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    width: 320px;
    max-width: 90vw;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.captcha-box h3 {
    font-size: 16px;
    margin-bottom: 6px;
    color: #2c2c2c;
}

.captcha-tip {
    font-size: 12px;
    color: #8a8a8a;
    margin-bottom: 14px;
}

.captcha-display {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 8px;
    color: #c4522a;
    background: #f6f5f2;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 14px;
    cursor: pointer;
    user-select: none;
    font-family: "Courier New", monospace;
}

.captcha-display:hover {
    background: #f0ede8;
}

.captcha-box input {
    width: 100%;
    padding: 10px 12px;
    font-size: 16px;
    border: 1px solid #e8e5e0;
    border-radius: 8px;
    outline: none;
    text-align: center;
    letter-spacing: 4px;
    font-weight: 600;
    margin-bottom: 8px;
}

.captcha-box input:focus {
    border-color: #c4522a;
}

.captcha-error {
    font-size: 12px;
    color: #e74c3c;
    min-height: 18px;
    margin-bottom: 6px;
}

.captcha-buttons {
    display: flex;
    gap: 10px;
}

.captcha-btn {
    flex: 1;
    padding: 9px 0;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.captcha-btn:hover {
    opacity: 0.85;
}

.captcha-btn.cancel {
    background: #f0ede8;
    color: #666;
}

.captcha-btn.confirm {
    background: #c4522a;
    color: #fff;
}

/* ========== 浮动上传按钮 ========== */
.floating-upload-btn {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #c4522a;
    color: #fff;
    font-size: 28px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(196, 82, 42, 0.4);
    z-index: 100;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.floating-upload-btn:hover {
    background: #a8441f;
    box-shadow: 0 6px 20px rgba(196, 82, 42, 0.5);
    transform: translateY(-2px);
}

.floating-upload-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(196, 82, 42, 0.3);
}

/* ========== 上传相关弹窗 ========== */
.upload-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.upload-modal.active {
    display: flex;
}

.upload-box {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    width: 340px;
    max-width: 90vw;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.upload-box h3 {
    font-size: 16px;
    margin-bottom: 10px;
    color: #2c2c2c;
}

.upload-tip {
    font-size: 13px;
    color: #8a8a8a;
    margin-bottom: 6px;
}

.upload-box input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #e8e5e0;
    border-radius: 8px;
    outline: none;
    margin-bottom: 10px;
    margin-top: 6px;
}

.upload-box input[type="password"]:focus {
    border-color: #c4522a;
}

.upload-file-area {
    border: 2px dashed #e0dcd5;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
    margin-bottom: 10px;
    font-size: 13px;
    color: #8a8a8a;
}

.upload-file-area:hover {
    border-color: #c4522a;
    background: #faf8f5;
}

.upload-file-area.selected {
    border-color: #c4522a;
    color: #2c2c2c;
}

.upload-progress {
    margin-bottom: 10px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #f0ede8;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 4px;
}

.progress-fill {
    height: 100%;
    background: #c4522a;
    border-radius: 4px;
    width: 0%;
    transition: width 0.2s ease;
}

.progress-text {
    font-size: 12px;
    color: #8a8a8a;
}

.upload-error {
    font-size: 12px;
    color: #e74c3c;
    min-height: 18px;
    margin-bottom: 6px;
}

.upload-success {
    font-size: 12px;
    color: #27ae60;
    min-height: 18px;
    margin-bottom: 6px;
}

.upload-buttons {
    display: flex;
    gap: 10px;
}

.upload-btn {
    flex: 1;
    padding: 9px 0;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.upload-btn:hover {
    opacity: 0.85;
}

.upload-btn.cancel {
    background: #f0ede8;
    color: #666;
}

.upload-btn.confirm {
    background: #c4522a;
    color: #fff;
}

/* ========================================
   手机端自适应（屏幕宽度 ≤ 768px）
   ======================================== */
@media (max-width: 768px) {

    .topbar {
        padding: 10px 0;
    }

    .topbar-inner {
        padding: 0 14px;
        gap: 8px;
        flex-wrap: wrap;
    }

    .logo {
        font-size: 16px;
    }

    .tagline {
        font-size: 11px;
    }

    .container {
        padding: 14px 10px;
    }

    .layout {
        flex-direction: column;
        gap: 14px;
    }

    .sidebar {
        width: 100%;
        flex-direction: column;
        gap: 14px;
    }

    .file-panel {
        order: -1;
        min-height: auto;
        border-radius: var(--radius);
    }

    .sidebar-left {
        order: 1;
    }

    .sidebar-right {
        order: 2;
    }

    .notice-widget {
        min-height: auto;
        flex: none;
    }

    .contact-widget,
    .time-widget {
        min-height: auto;
    }

    .panel-header {
        padding: 12px 14px;
    }

    .panel-header h2 {
        font-size: 14px;
    }

    .file-count {
        font-size: 11px;
        padding: 2px 8px;
    }

    .search-box {
        margin: 10px 12px;
        padding: 7px 10px;
    }

    .search-box input {
        font-size: 14px;
    }

    .file-row {
        padding: 10px 12px;
        gap: 8px;
    }

    .file-icon {
        width: 30px;
        height: 30px;
        font-size: 14px;
        border-radius: 6px;
    }

    .file-name {
        font-size: 12px;
    }

    .file-meta {
        font-size: 10px;
    }

    .download-btn {
        padding: 6px 12px;
        font-size: 11px;
        min-width: 44px;
        text-align: center;
    }

    .file-list {
        max-height: 400px;
    }

    .empty-state {
        padding: 30px 14px;
        font-size: 12px;
    }

    .contact-item {
        padding: 10px 0;
        font-size: 13px;
    }

    .contact-icon {
        font-size: 16px;
    }

    .footer {
        padding: 12px 10px;
        font-size: 11px;
    }

    .floating-upload-btn {
        right: 16px;
        bottom: 16px;
        width: 46px;
        height: 46px;
        font-size: 24px;
    }
}

/* ========================================
   超小屏幕（屏幕宽度 ≤ 380px）
   ======================================== */
@media (max-width: 380px) {

    .topbar-inner {
        flex-direction: column;
        gap: 2px;
    }

    .logo {
        font-size: 15px;
    }

    .tagline {
        font-size: 10px;
    }

    .file-row {
        padding: 8px 10px;
        gap: 6px;
    }

    .file-icon {
        width: 26px;
        height: 26px;
        font-size: 12px;
    }

    .file-name {
        font-size: 11px;
    }

    .file-meta {
        font-size: 9px;
    }

    .download-btn {
        padding: 5px 8px;
        font-size: 10px;
        min-width: 36px;
    }

    .widget {
        padding: 12px 14px;
    }
}