/* ============================================================
   奶狗网盘 全局样式（奶狗主题：奶油白 × 暖棕 × 橙）
   ============================================================ */
:root {
    --bg: #fdf7ee;
    --bg2: #f7ecdc;
    --card: #ffffff;
    --primary: #d97730;
    --primary-dark: #b8611f;
    --brown: #7a4a21;
    --brown-light: #a6805a;
    --text: #3d2b16;
    --text-2: #8a6d4d;
    --border: #ead9bd;
    --danger: #d94f4f;
    --success: #2e9e5b;
    --shadow: 0 8px 24px rgba(180, 120, 50, .12);
    --radius: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ---------- 通用组件 ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    background: var(--primary);
    color: #fff;
    white-space: nowrap;
}
.btn:hover { background: var(--primary-dark); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { padding: 5px 12px; font-size: 13px; border-radius: 8px; }
.btn-outline { background: transparent; color: var(--brown); border: 1px solid var(--border); }
.btn-outline:hover { background: var(--bg2); border-color: var(--brown-light); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #c53f3f; }
.btn-green { background: var(--success); }
.btn-green:hover { background: #238049; }
.btn-gray { background: #d8cdba; color: var(--brown); }
.btn-gray:hover { background: #c9bca6; }

.input, .select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    background: #fff;
    color: var(--text);
    transition: border .15s;
}
.input:focus, .select:focus { border-color: var(--primary); }
.input::placeholder { color: #c4ae8f; }

/* 卡片 */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(234, 217, 189, .5);
}

/* 提示条 */
.msg {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 14px;
    display: none;
}
.msg.show { display: block; }
.msg.error { background: #fdecec; color: #c0392b; border: 1px solid #f5c6c6; }
.msg.success { background: #e9f7ef; color: #1e7a3c; border: 1px solid #b7e3c8; }
.msg.info { background: #eef5fb; color: #2a6a96; border: 1px solid #c3dced; }

/* 遮罩弹窗 */
.modal-mask {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(61, 43, 22, .45);
    display: none;
    align-items: center; justify-content: center;
    padding: 20px;
}
.modal-mask.show { display: flex; }
.modal {
    background: #fff;
    border-radius: 16px;
    width: 100%; max-width: 440px;
    padding: 26px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    animation: pop .18s ease;
}
@keyframes pop { from { transform: scale(.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal h3 { font-size: 17px; color: var(--brown); margin-bottom: 18px; }
.modal .form-row { margin-bottom: 14px; }
.modal label { display: block; font-size: 13px; color: var(--brown); font-weight: 600; margin-bottom: 6px; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.modal .hint { font-size: 12px; color: var(--text-2); margin-top: 5px; }

/* ---------- 登录页 ---------- */
.login-body {
    min-height: 100vh;
    background: linear-gradient(135deg, #fff7e6 0%, #ffe8cc 55%, #ffd9a8 100%);
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.login-wrap { width: 100%; max-width: 420px; }
.login-logo {
    text-align: center; margin-bottom: 26px;
}
.login-logo .dog {
    font-size: 64px; line-height: 1; filter: drop-shadow(0 6px 12px rgba(217,119,48,.35));
}
.login-logo h1 { font-size: 28px; color: var(--brown); margin-top: 8px; letter-spacing: 2px; }
.login-logo p { color: var(--brown-light); font-size: 13px; margin-top: 4px; }
.login-card { padding: 32px 30px; }
.tabs { display: flex; background: var(--bg2); border-radius: 12px; padding: 4px; margin-bottom: 24px; }
.tabs button {
    flex: 1; padding: 10px 0; border: none; background: transparent;
    font-size: 15px; font-weight: 600; color: var(--text-2);
    border-radius: 9px; cursor: pointer; transition: all .15s;
}
.tabs button.active { background: #fff; color: var(--primary); box-shadow: 0 2px 8px rgba(180,120,50,.15); }
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-size: 13px; color: var(--brown); font-weight: 600; margin-bottom: 6px; }
.form-row .hint { font-size: 12px; color: var(--text-2); margin-top: 5px; }
.login-btn { width: 100%; padding: 12px; font-size: 16px; }
.login-notice {
    margin-top: 16px; font-size: 12.5px; color: var(--text-2); text-align: center;
    background: var(--bg2); border-radius: 10px; padding: 10px; line-height: 1.7;
}

/* ---------- 主面板 ---------- */
.topbar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: 62px;
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 50;
}
.topbar .brand { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; color: var(--brown); }
.topbar .brand .dog { font-size: 26px; }
.topbar .right { display: flex; align-items: center; gap: 12px; }
.topbar .user-box { display: flex; align-items: center; gap: 10px; }
.topbar .avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #f0a860);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: 700;
}
.topbar .nickname { color: var(--brown); font-weight: 600; }

.panel-body { max-width: 1200px; margin: 0 auto; padding: 24px 20px 60px; }

/* 公告 */
.notice-bar {
    background: linear-gradient(90deg, #fff3e0, #ffe9c9);
    border: 1px solid #f2ddb8;
    border-radius: 12px;
    padding: 12px 18px;
    margin-bottom: 18px;
    font-size: 13.5px; color: #7a4a21;
    display: flex; align-items: center; gap: 10px;
}
.notice-bar .tag {
    flex-shrink: 0; background: var(--primary); color: #fff;
    font-size: 12px; padding: 2px 10px; border-radius: 999px; font-weight: 700;
}

/* 空间条 */
.quota-card {
    padding: 18px 22px;
    margin-bottom: 20px;
    display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
}
.quota-card .q-left { flex: 1; min-width: 200px; }
.quota-card .q-title { font-size: 14px; color: var(--brown); font-weight: 600; margin-bottom: 8px; }
.quota-bar { height: 12px; background: var(--bg2); border-radius: 999px; overflow: hidden; }
.quota-bar .fill {
    height: 100%; border-radius: 999px;
    background: linear-gradient(90deg, #f0a860, var(--primary));
    transition: width .4s;
}
.quota-card .q-text { font-size: 12.5px; color: var(--text-2); margin-top: 6px; }
.quota-card .q-right { display: flex; gap: 10px; }

/* 面板 tab */
.panel-tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.panel-tabs .ptab {
    padding: 9px 22px; border: 1px solid var(--border); background: #fff;
    border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--text-2);
    cursor: pointer; transition: all .15s;
}
.panel-tabs .ptab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 文件区 */
.file-card { padding: 8px 18px 18px; }
.toolbar { display: flex; align-items: center; gap: 10px; padding: 14px 4px; flex-wrap: wrap; }
.crumbs { display: flex; align-items: center; gap: 4px; font-size: 14px; color: var(--text-2); flex: 1; flex-wrap: wrap; }
.crumbs a { color: var(--brown); font-weight: 600; }
.crumbs .sep { color: #c9b896; }

.file-table { width: 100%; border-collapse: collapse; }
.file-table th {
    text-align: left; font-size: 12.5px; color: var(--text-2);
    font-weight: 600; padding: 10px 12px; border-bottom: 2px solid var(--border);
}
.file-table td { padding: 11px 12px; border-bottom: 1px solid #f3e9d7; vertical-align: middle; }
.file-table tr:hover { background: #fdf8f0; }
.file-table tr.selected { background: #fff3e0; }
.file-icon { font-size: 20px; margin-right: 10px; vertical-align: middle; }
.file-name { font-weight: 600; color: var(--text); cursor: pointer; }
.folder-name { font-weight: 600; color: var(--brown); cursor: pointer; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.empty-tip {
    text-align: center; padding: 60px 20px; color: var(--text-2);
}
.empty-tip .big { font-size: 52px; margin-bottom: 12px; opacity: .8; }

/* 分享区 */
.share-card { padding: 18px; }
.share-create { margin-bottom: 16px; }
.share-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.share-item {
    padding: 18px; border: 1px solid var(--border); border-radius: 12px;
    background: #fff; transition: all .15s;
}
.share-item:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.share-item .code-badge {
    display: inline-block; background: var(--bg2); color: var(--primary);
    font-size: 18px; font-weight: 800; letter-spacing: 4px;
    padding: 4px 14px; border-radius: 8px; font-family: Consolas, monospace;
}
.share-item h4 { color: var(--brown); font-size: 15px; margin: 10px 0 6px; }
.share-item .meta { font-size: 12.5px; color: var(--text-2); line-height: 1.9; }
.share-item .status-tag {
    font-size: 11px; padding: 2px 8px; border-radius: 999px; font-weight: 700; margin-left: 6px;
}
.status-tag.active { background: #e9f7ef; color: var(--success); }
.status-tag.expired, .status-tag.full { background: #fdecec; color: var(--danger); }
.share-item .ops { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.copy-url { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 分享查看页 ---------- */
.share-view-body { max-width: 860px; margin: 0 auto; padding: 30px 20px 60px; }
.share-hero {
    text-align: center; padding: 34px 20px; margin-bottom: 20px;
    background: linear-gradient(135deg, #fff7e6, #ffe8cc);
}
.share-hero .dog { font-size: 54px; }
.share-hero h2 { color: var(--brown); font-size: 22px; margin: 10px 0 6px; }
.share-hero .sub { color: var(--text-2); font-size: 13.5px; }
.share-hero .code-big {
    display: inline-block; margin-top: 12px; font-size: 26px; font-weight: 800;
    letter-spacing: 8px; color: var(--primary); background: #fff;
    padding: 8px 24px; border-radius: 12px; border: 2px dashed #f0c896;
    font-family: Consolas, monospace;
}
.password-box { max-width: 360px; margin: 0 auto 20px; }
.password-box .input { text-align: center; letter-spacing: 2px; }
.file-list { padding: 10px 18px 18px; }

/* ---------- 管理员后台 ---------- */
.admin-body { display: flex; min-height: 100vh; }
.admin-side {
    width: 220px; background: var(--brown); color: #f5e8d5;
    padding: 24px 0; flex-shrink: 0;
}
.admin-side .brand { padding: 0 22px 20px; font-size: 18px; font-weight: 700; border-bottom: 1px solid rgba(255,255,255,.15); }
.admin-side .nav { margin-top: 16px; }
.admin-side .nav a {
    display: block; padding: 11px 22px; color: #e8d5bc; font-size: 14px;
    border-left: 3px solid transparent; transition: all .15s;
}
.admin-side .nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.admin-side .nav a.active { background: rgba(255,255,255,.12); color: #fff; border-left-color: #f0a860; }
.admin-main { flex: 1; padding: 26px 30px; min-width: 0; }
.admin-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; flex-wrap: wrap; gap: 12px; }
.admin-head h2 { color: var(--brown); font-size: 20px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card { padding: 18px; }
.stat-card .num { font-size: 26px; font-weight: 800; color: var(--primary); }
.stat-card .lbl { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { text-align: left; font-size: 12.5px; color: var(--text-2); padding: 10px 12px; border-bottom: 2px solid var(--border); }
.admin-table td { padding: 10px 12px; border-bottom: 1px solid #f3e9d7; }
.pager { display: flex; gap: 8px; align-items: center; margin-top: 16px; justify-content: flex-end; }
.search-bar { display: flex; gap: 10px; max-width: 420px; }
.search-bar .input { flex: 1; }

.badge { display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 999px; font-weight: 600; }
.badge-normal { background: #e9f7ef; color: var(--success); }
.badge-banned { background: #fdecec; color: var(--danger); }
.badge-admin { background: #fff3e0; color: var(--primary); }

/* 响应式 */
@media (max-width: 720px) {
    .topbar { padding: 0 14px; }
    .panel-body { padding: 16px 12px 50px; }
    .admin-side { width: 64px; }
    .admin-side .brand { font-size: 14px; padding: 0 12px 16px; text-align: center; }
    .admin-side .nav a { padding: 12px; text-align: center; font-size: 12px; }
    .admin-main { padding: 16px 12px; }
    .file-table th:nth-child(3), .file-table td:nth-child(3) { display: none; }
}
