/* ===== 网盘分享站 - 风铃风格 ===== */
:root {
    --primary: #4a90d9;
    --primary-dark: #357abd;
    --primary-light: #e8f1fc;
    --bg: #f5f6f8;
    --card-bg: #ffffff;
    --text: #333;
    --text-muted: #999;
    --border: #eee;
    --success: #52c41a;
    --danger: #ff4d4f;
    --header-h: 120px;
    --nav-h: 56px;
}
* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { text-decoration:none; color:inherit; }

#app {
    max-width: 500px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* ===== 顶部区域 ===== */
.app-header {
    background: linear-gradient(135deg, var(--primary) 0%, #6ab0f3 100%);
    padding: 16px;
    padding-top: env(safe-area-inset-top, 16px);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.site-title {
    color: #fff;
    font-size: 20px;
    font-weight: 700;
}
.site-desc {
    color: rgba(255,255,255,0.8);
    font-size: 12px;
}
.header-avatar .avatar-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    background: rgba(255,255,255,0.25);
    border-radius: 50%;
}
.avatar-text { color:#fff; font-weight:600; font-size:14px; text-transform:uppercase; }
.avatar-icon { font-size:18px; }

/* 搜索栏 */
.search-bar {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.95);
    border-radius: 22px;
    padding: 0 16px;
    height: 40px;
}
.search-bar input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    font-size: 14px;
    color: #333;
}
.search-bar .search-icon { font-size: 16px; color: #999; margin-right: 8px; }
.search-bar .search-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 14px;
    padding: 4px 14px;
    font-size: 13px;
    cursor: pointer;
}

/* ===== 滚动公告条 ===== */
.notice-bar {
    display: flex;
    align-items: center;
    background: #fff;
    padding: 8px 12px;
    margin: 0;
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}
.notice-bar .notice-icon { flex-shrink: 0; margin-right: 8px; font-size: 16px; }
.notice-bar .notice-text {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 13px;
    color: #666;
}

/* ===== 主内容区 ===== */
.app-main {
    flex: 1;
    padding: 12px;
    padding-bottom: calc(var(--nav-h) + 20px);
}

/* ===== 分类圆形入口 ===== */
.category-nav {
    display: flex;
    overflow-x: auto;
    gap: 4px;
    padding: 12px 0;
    background: #fff;
    margin: 0 -12px;
    padding-left: 12px;
    padding-right: 12px;
    border-radius: 0;
}
.category-nav::-webkit-scrollbar { display: none; }
.cat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 64px;
    cursor: pointer;
    flex-shrink: 0;
}
.cat-item .cat-icon {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    transition: all 0.2s;
}
.cat-item.active .cat-icon {
    background: var(--primary);
    transform: scale(1.05);
}
.cat-item .cat-name {
    font-size: 11px;
    color: #666;
    white-space: nowrap;
}
.cat-item.active .cat-name {
    color: var(--primary);
    font-weight: 600;
}

/* ===== 文件列表卡片 ===== */
.file-list { margin-top: 12px; }
.file-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card-bg);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    transition: transform 0.15s;
}
.file-card:active { transform: scale(0.98); }
.file-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}
.file-info { flex: 1; min-width: 0; }
.file-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.file-desc {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    gap: 8px;
    align-items: center;
}
.file-desc .pwd-tag {
    color: var(--danger);
    font-size: 11px;
}
.file-download {
    flex-shrink: 0;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}
.file-download:active { background: var(--primary-dark); }

/* ===== 分类标题 ===== */
.section-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 16px 0 8px;
}
.section-icon { font-size: 16px; }
.section-title { font-size: 15px; font-weight: 600; }
.section-desc { font-size: 12px; color: var(--text-muted); margin-left: auto; }

/* ===== 公告卡片 ===== */
.announcement-card {
    background: #fff;
    border-radius: 12px;
    padding: 14px 16px;
    border-left: 3px solid var(--primary);
    margin-bottom: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.announcement-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.announcement-content { font-size: 13px; color: #666; line-height: 1.6; }
.announcement-time { font-size: 11px; color: var(--text-muted); margin-top: 6px; }

/* ===== 弹窗公告 ===== */
.popup-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
}
.popup-card {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.popup-header {
    background: linear-gradient(135deg, var(--primary) 0%, #6ab0f3 100%);
    color: #fff;
    padding: 20px 16px;
    text-align: center;
    position: relative;
}
.popup-header h3 { font-size: 17px; }
.popup-close {
    position: absolute;
    top: 10px; right: 12px;
    background: rgba(255,255,255,0.3);
    border: none;
    color: #fff;
    width: 28px; height: 28px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
}
.popup-body {
    padding: 20px 16px;
    overflow-y: auto;
    font-size: 14px;
    color: #555;
    line-height: 1.8;
}
.popup-body .ann-item {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}
.popup-body .ann-item:last-child { border-bottom: none; margin-bottom: 0; }
.popup-body .ann-item h4 { font-size: 15px; margin-bottom: 6px; color: #333; }

/* ===== 表单 ===== */
.auth-form-wrap { margin-top: 20px; }
.auth-form {
    background: #fff;
    border-radius: 16px;
    padding: 24px 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.form-group { margin-bottom: 16px; }
.form-group label { display:block; font-size:13px; font-weight:500; color:#555; margin-bottom:6px; }
.form-input, .form-textarea {
    width: 100%; padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px; font-size: 15px;
    background: var(--bg); outline: none;
    transition: border-color 0.2s;
}
.form-input:focus, .form-textarea:focus { border-color: var(--primary); background:#fff; }
.form-textarea { resize: vertical; font-family: inherit; }
.btn-primary {
    background: var(--primary); color:#fff; border:none;
    padding: 12px 24px; border-radius: 10px;
    font-size: 15px; font-weight: 600; cursor: pointer;
}
.btn-primary:active { background: var(--primary-dark); }
.btn-block { width: 100%; }
.auth-link { text-align:center; margin-top:16px; font-size:14px; color:var(--text-muted); }
.auth-link a { color: var(--primary); font-weight:500; }

.alert-success { background: rgba(82,196,26,0.1); color: var(--success); border-radius:10px; padding:12px 16px; font-size:14px; margin-bottom:16px; }
.alert-error { background: rgba(255,77,79,0.1); color: var(--danger); border-radius:10px; padding:12px 16px; font-size:14px; margin-bottom:16px; }
.empty-state { text-align:center; padding:40px 20px; color:var(--text-muted); font-size:14px; }

/* ===== 底部导航 ===== */
.bottom-nav {
    height: var(--nav-h);
    background: #fff;
    border-top: 1px solid var(--border);
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    max-width: 500px;
    margin: 0 auto;
    z-index: 200;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
}
.nav-item {
    flex: 1;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 2px;
    color: #999;
    transition: color 0.2s;
    position: relative;
}
.nav-item.active { color: var(--primary); }
.nav-item.active::before {
    content: ''; position: absolute; top: 0; left: 50%;
    transform: translateX(-50%);
    width: 30px; height: 3px;
    background: var(--primary); border-radius: 0 0 3px 3px;
}
.nav-icon { font-size: 22px; }
.nav-label { font-size: 11px; font-weight: 500; }

/* ===== 文章 ===== */
.article-card { display:block; background:#fff; border-radius:12px; padding:16px; margin-bottom:8px; box-shadow:0 1px 4px rgba(0,0,0,0.05); }
.article-card:active { transform: scale(0.98); }
.article-title { font-size:16px; font-weight:600; margin-bottom:8px; }
.article-excerpt { font-size:13px; color:#888; line-height:1.6; margin-bottom:10px; overflow:hidden; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.article-meta { display:flex; gap:12px; font-size:11px; color:var(--text-muted); }
.article-detail { background:#fff; border-radius:12px; padding:24px 16px; box-shadow:0 1px 4px rgba(0,0,0,0.05); }
.article-detail-title { font-size:20px; font-weight:700; margin-bottom:12px; line-height:1.4; }
.article-detail-meta { display:flex; gap:16px; font-size:12px; color:var(--text-muted); margin-bottom:20px; padding-bottom:16px; border-bottom:1px solid var(--border); }
.article-detail-content { font-size:15px; line-height:1.8; color:#333; }
.post-section { margin-bottom: 20px; }
.btn-toggle-post { width:100%; padding:12px; border:2px dashed var(--primary); background:rgba(74,144,217,0.05); color:var(--primary); border-radius:12px; font-size:14px; font-weight:500; cursor:pointer; }
.post-form { background:#fff; border-radius:12px; padding:16px; margin-top:10px; box-shadow:0 1px 4px rgba(0,0,0,0.05); }
.login-hint { text-align:center; padding:20px; color:var(--text-muted); font-size:14px; }
.login-hint a { color:var(--primary); font-weight:500; }
.back-btn { color:#fff; font-size:16px; font-weight:500; }

@media (min-width: 501px) { body { background: linear-gradient(135deg, #e0e7ff 0%, #f5f6f8 100%); } }
