/* 星空博客 · 后台管理样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #eef1f8;
    color: #2c3145;
    line-height: 1.6;
}
a { text-decoration: none; color: inherit; }

/* 登录页 */
.login-page {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(160deg,#2b3a67 0%,#4a5a9c 30%,#8a7bb8 55%,#e8a87c 80%,#f6d6b8 100%);
    padding: 20px;
}
.login-box {
    width: 100%; max-width: 400px;
    background: rgba(255,255,255,0.92);
    border-radius: 20px; padding: 40px 36px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
}
.login-box h1 { text-align: center; font-size: 24px; margin-bottom: 6px; color: #3a3a5a; }
.login-box .sub { text-align: center; color: #999; font-size: 13px; margin-bottom: 28px; }
.login-box .form-group { margin-bottom: 18px; }
.login-box label { display: block; margin-bottom: 6px; font-size: 14px; color: #555; font-weight: 600; }
.login-box input {
    width: 100%; padding: 12px 16px; border: 1px solid #ddd;
    border-radius: 10px; font-size: 14px; transition: 0.2s;
}
.login-box input:focus { outline: none; border-color: #667eea; box-shadow: 0 0 0 3px rgba(102,126,234,0.15); }

.btn {
    display: inline-block; padding: 11px 22px; border: none; cursor: pointer;
    background: linear-gradient(135deg,#667eea,#c99e8c); color: #fff;
    border-radius: 10px; font-size: 14px; font-weight: 600; transition: 0.2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(102,126,234,0.35); }
.btn-block { width: 100%; text-align: center; }
.btn-sm { padding: 6px 14px; font-size: 13px; border-radius: 8px; }
.btn-danger { background: linear-gradient(135deg,#e74c3c,#c0392b); }
.btn-gray { background: #8a92ad; }

/* 布局 */
.admin-layout { display: flex; min-height: 100vh; }
.sidebar {
    width: 230px; flex-shrink: 0;
    background: linear-gradient(180deg,#2b3a67,#4a3f7a);
    color: #fff; padding: 24px 0; position: fixed; top: 0; bottom: 0; left: 0;
    overflow-y: auto;
}
.sidebar .brand { padding: 0 24px 24px; font-size: 20px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.sidebar .brand span { color: #ffe9b0; }
.sidebar nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 13px 24px; font-size: 15px; color: rgba(255,255,255,0.8);
    transition: 0.2s; border-left: 3px solid transparent;
}
.sidebar nav a:hover, .sidebar nav a.active {
    background: rgba(255,255,255,0.1); color: #fff; border-left-color: #ffe9b0;
}
.sidebar .side-foot { padding: 20px 24px; font-size: 13px; }
.sidebar .side-foot a { color: rgba(255,255,255,0.6); display: block; margin-bottom: 8px; }

.main { flex: 1; margin-left: 230px; padding: 30px 36px; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 26px; }
.topbar h1 { font-size: 24px; color: #2c3145; }

/* 卡片 */
.panel { background: #fff; border-radius: 14px; padding: 24px 26px; box-shadow: 0 6px 24px rgba(60,70,120,0.08); margin-bottom: 22px; }

/* 仪表盘统计 */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(200px,1fr)); gap: 18px; margin-bottom: 26px; }
.stat-card {
    background: #fff; border-radius: 14px; padding: 24px;
    box-shadow: 0 6px 24px rgba(60,70,120,0.08);
    display: flex; align-items: center; gap: 16px;
}
.stat-icon {
    width: 52px; height: 52px; border-radius: 14px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 24px; color: #fff;
    background: linear-gradient(135deg,#667eea,#c99e8c);
}
.stat-num { font-size: 26px; font-weight: 700; color: #2c3145; }
.stat-label { font-size: 13px; color: #999; }

/* 表格 */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 12px; text-align: left; border-bottom: 1px solid #eef0f5; font-size: 14px; }
th { color: #8a92ad; font-weight: 600; font-size: 13px; }
tr:hover td { background: #f9fafd; }
td .thumb { width: 54px; height: 40px; object-fit: cover; border-radius: 6px; }
.actions { display: flex; gap: 8px; }

/* 表单 */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 14px; color: #555; font-weight: 600; }
.form-group input[type=text],
.form-group input[type=url],
.form-group input[type=email],
.form-group input[type=number],
.form-group input[type=password],
.form-group select,
.form-group textarea {
    width: 100%; padding: 11px 14px; border: 1px solid #dde1ea;
    border-radius: 10px; font-size: 14px; font-family: inherit; transition: 0.2s;
}
.form-group textarea { min-height: 320px; resize: vertical; line-height: 1.7; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: #667eea; box-shadow: 0 0 0 3px rgba(102,126,234,0.12);
}
.form-group small { color: #aaa; font-size: 12px; }
.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }

/* 提示 */
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 20px; font-size: 14px; }
.flash-success { background: #e8f8f0; color: #27ae60; }
.flash-error { background: #fde8e8; color: #c0392b; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 12px; }
.badge-on { background: #e8f8f0; color: #27ae60; }
.badge-off { background: #fdecec; color: #e74c3c; }

.empty { text-align: center; color: #aaa; padding: 40px; }

/* 上传预览 */
.upload-preview { margin-top: 10px; }
.upload-preview img { max-width: 200px; border-radius: 8px; }
.gallery-manage { display: grid; grid-template-columns: repeat(auto-fill,minmax(180px,1fr)); gap: 16px; }
.gallery-manage .g-item { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 6px 20px rgba(60,70,120,0.08); }
.gallery-manage .g-item img { width: 100%; height: 140px; object-fit: cover; }
.gallery-manage .g-item .g-body { padding: 10px 12px; }
.gallery-manage .g-item .g-title { font-size: 14px; font-weight: 600; margin-bottom: 6px; }

@media (max-width: 768px) {
    .sidebar { width: 100%; position: static; height: auto; }
    .main { margin-left: 0; padding: 20px; }
    .admin-layout { flex-direction: column; }
    .form-row { flex-direction: column; }
}
