/* ============================================
   新音院 - 管理后台 深色主题样式
   ============================================ */

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

:root {
    --bg-dark: #121418;
    --bg-card: #1a1c20;
    --bg-input: #22252b;
    --bg-hover: #2a2e38;
    --text-white: #ffffff;
    --text-gray: #9aa0a9;
    --text-dim: #6c727a;
    --accent-green: #26e893;
    --accent-green-dim: rgba(38, 232, 147, 0.15);
    --red-del: #ef5350;
    --border: rgba(255, 255, 255, 0.06);
    --radius: 12px;
    --radius-sm: 8px;
}

html { font-size: 16px; }

body {
    font-family: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", -apple-system, sans-serif;
    background: var(--bg-dark);
    color: var(--text-white);
    min-height: 100vh;
}

/* ===== 登录页 ===== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 380px;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px 32px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    background: var(--accent-green);
    color: var(--bg-dark);
    font-size: 1.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
}

.login-header h1 {
    font-size: 1.2rem;
    color: var(--text-white);
    font-weight: 600;
    letter-spacing: 2px;
    margin-bottom: 6px;
}

.login-header p {
    font-size: 0.82rem;
    color: var(--text-dim);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.78rem;
    color: var(--text-gray);
    letter-spacing: 1px;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="file"] {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    color: var(--text-white);
    font-size: 0.9rem;
    transition: border-color 0.25s;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-green);
}

.form-group input::placeholder {
    color: var(--text-dim);
}

.btn {
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.25s;
    font-family: inherit;
    letter-spacing: 1px;
}

.btn-primary {
    background: var(--accent-green);
    color: var(--bg-dark);
    font-weight: 600;
}

.btn-primary:hover {
    background: #2cf0a0;
    transform: translateY(-1px);
}

.btn-block {
    width: 100%;
    padding: 12px;
    margin-top: 4px;
}

.alert {
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    margin-bottom: 20px;
}

.alert-error {
    background: rgba(239, 83, 80, 0.12);
    color: var(--red-del);
    border: 1px solid rgba(239, 83, 80, 0.2);
}

.alert-info {
    background: rgba(38, 232, 147, 0.08);
    color: var(--accent-green);
    border: 1px solid rgba(38, 232, 147, 0.15);
    margin-bottom: 20px;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
}

.login-footer a {
    color: var(--text-dim);
    font-size: 0.8rem;
    text-decoration: none;
    transition: color 0.25s;
}

.login-footer a:hover {
    color: var(--text-gray);
}

/* ===== 后台主页面 ===== */
.top-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 28px;
    background: rgba(14, 16, 20, 0.88);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.top-bar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.top-bar-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-white);
    letter-spacing: 2px;
}

.top-bar-right {
    display: flex;
    gap: 16px;
    align-items: center;
}

.top-bar-link {
    color: var(--text-gray);
    text-decoration: none;
    font-size: 0.8rem;
    transition: color 0.25s;
    letter-spacing: 1px;
}

.top-bar-link:hover {
    color: var(--text-white);
}

/* ===== 主内容区 ===== */
.dashboard-main {
    max-width: 1240px;
    margin: 0 auto;
    padding: 28px 28px 60px;
}

.dashboard-intro {
    margin-bottom: 24px;
}

.dashboard-intro h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-white);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dashboard-intro h2::before {
    content: '';
    width: 7px;
    height: 7px;
    background: var(--accent-green);
    transform: rotate(45deg);
    display: inline-block;
}

.dashboard-intro p {
    font-size: 0.82rem;
    color: var(--text-dim);
    margin-left: 15px;
}

/* ===== 专栏卡片网格 ===== */
.sections-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.admin-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.admin-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}

.admin-card-header h3 {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-white);
    letter-spacing: 2px;
}

.img-count {
    font-size: 0.72rem;
    color: var(--text-dim);
    background: var(--bg-input);
    padding: 3px 10px;
    border-radius: 20px;
}

.admin-card-body {
    padding: 18px;
}

/* ===== 上传表单 ===== */
.upload-form {
    margin-bottom: 16px;
}

.upload-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.file-label {
    flex: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.file-label input[type="file"] {
    display: none;
}

.file-btn {
    display: inline-block;
    padding: 9px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-gray);
    font-size: 0.8rem;
    transition: all 0.25s;
    white-space: nowrap;
}

.file-label:hover .file-btn {
    background: var(--bg-hover);
    color: var(--text-white);
}

.btn-upload {
    background: var(--accent-green);
    color: var(--bg-dark);
    font-weight: 600;
    padding: 9px 20px;
    font-size: 0.8rem;
    white-space: nowrap;
}

.btn-upload:hover {
    background: #2cf0a0;
}

.upload-hint {
    font-size: 0.72rem;
    color: var(--text-dim);
    margin-top: 8px;
}

/* ===== 图片列表 ===== */
.img-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.img-item {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-input);
}

.img-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
}

.img-info {
    padding: 4px 6px;
    background: rgba(0, 0, 0, 0.5);
}

.img-name {
    font-size: 0.65rem;
    color: var(--text-gray);
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.delete-form {
    position: absolute;
    top: 6px;
    right: 6px;
}

.btn-delete {
    background: rgba(239, 83, 80, 0.85);
    color: var(--text-white);
    border: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 0.72rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.25s;
}

.btn-delete:hover {
    background: var(--red-del);
}

.no-img {
    color: var(--text-dim);
    font-size: 0.8rem;
    text-align: center;
    padding: 24px 0;
}

/* ===== 底部 ===== */
.dashboard-footer {
    text-align: center;
    padding: 16px 0;
    border-top: 1px solid var(--border);
    margin-top: 40px;
}

.dashboard-footer p {
    color: var(--text-dim);
    font-size: 0.72rem;
    letter-spacing: 2px;
}

/* ============================================
   响应式 - 手机
   ============================================ */
@media (max-width: 768px) {
    .top-bar {
        padding: 10px 16px;
    }

    .top-bar-title {
        font-size: 0.82rem;
    }

    .top-bar-link {
        font-size: 0.72rem;
    }

    .dashboard-main {
        padding: 20px 14px 40px;
    }

    .sections-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .admin-card-header {
        padding: 12px 14px;
    }

    .admin-card-header h3 {
        font-size: 0.85rem;
    }

    .admin-card-body {
        padding: 14px;
    }

    .upload-row {
        flex-direction: column;
        align-items: stretch;
    }

    .file-btn,
    .btn-upload {
        text-align: center;
        padding: 11px 16px;
        font-size: 0.82rem;
    }

    .img-list {
        grid-template-columns: repeat(2, 1fr);
    }

    .login-card {
        padding: 32px 24px;
    }
}

@media (max-width: 480px) {
    .img-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .top-bar-right {
        gap: 10px;
    }

    .sections-grid {
        gap: 12px;
    }
}
