/* =============== Admin Reset =============== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
    background: #f0f2f5;
    color: #333;
    display: flex;
    min-height: 100vh;
}

/* =============== Sidebar =============== */
.sidebar {
    width: 220px; background: #1a1a2e; color: #fff;
    display: flex; flex-direction: column; flex-shrink: 0;
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 100;
    transition: transform .3s;
}

.sidebar-header {
    padding: 22px 20px; font-size: 18px; font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,.08);
    display: flex; align-items: center; gap: 10px;
    letter-spacing: 2px;
}
.sidebar-header i { color: #a78bfa; font-size: 20px; }

.sidebar-nav { flex: 1; padding: 12px 0; }

.nav-link {
    display: flex; align-items: center; gap: 10px;
    padding: 13px 22px; color: rgba(255,255,255,.6);
    text-decoration: none; font-size: 14px; transition: all .2s;
    border-left: 3px solid transparent;
}
.nav-link:hover { color: #fff; background: rgba(255,255,255,.05); }
.nav-link.active {
    color: #fff; background: rgba(167,139,250,.12);
    border-left-color: #a78bfa;
}
.nav-link i { width: 18px; text-align: center; }

.sidebar-footer {
    padding: 15px 22px; border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-footer a {
    color: rgba(255,255,255,.5); text-decoration: none; font-size: 13px;
    display: flex; align-items: center; gap: 8px; transition: color .2s;
}
.sidebar-footer a:hover { color: #a78bfa; }

/* =============== Main =============== */
.main-content {
    flex: 1; margin-left: 220px; display: flex; flex-direction: column;
}

.topbar {
    height: 60px; background: #fff; display: flex; align-items: center;
    padding: 0 24px; box-shadow: 0 1px 3px rgba(0,0,0,.06);
    position: sticky; top: 0; z-index: 50; gap: 16px;
}

.menu-btn {
    display: none; background: none; border: none;
    font-size: 20px; color: #666; cursor: pointer;
}

.page-title { font-size: 17px; font-weight: 600; flex: 1; }

.topbar-actions { display: flex; gap: 10px; }

.content-area { padding: 24px; flex: 1; }

/* =============== Buttons =============== */
.btn {
    padding: 9px 18px; border: none; border-radius: 8px;
    font-size: 13px; font-weight: 600; cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    transition: all .2s;
}
.btn-primary { background: #7c3aed; color: #fff; }
.btn-primary:hover { background: #6d28d9; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-outline {
    background: transparent; border: 1px solid #d1d5db; color: #666;
}
.btn-outline:hover { border-color: #7c3aed; color: #7c3aed; }
.btn-delete { background: #fee2e2; color: #ef4444; }
.btn-delete:hover { background: #fecaca; }

/* =============== Card =============== */
.card {
    background: #fff; border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06); margin-bottom: 20px;
}
.card-header {
    padding: 16px 22px; border-bottom: 1px solid #f0f0f0;
    display: flex; align-items: center; justify-content: space-between;
}
.card-header h3 { font-size: 15px; font-weight: 600; }
.card-body { padding: 22px; }

/* =============== Form =============== */
.form-group {
    margin-bottom: 18px;
}
.form-group label {
    display: block; font-size: 13px; font-weight: 600;
    color: #555; margin-bottom: 6px;
}
.form-group input[type="text"],
.form-group input[type="url"],
.form-group textarea {
    width: 100%; padding: 10px 14px; border: 1px solid #e0e0e0;
    border-radius: 8px; font-size: 14px; transition: border-color .2s;
    outline: none;
}
.form-group input:focus,
.form-group textarea:focus {
    border-color: #7c3aed; box-shadow: 0 0 0 3px rgba(124,58,237,.1);
}
.form-group small {
    display: block; margin-top: 4px; font-size: 12px; color: #999;
}
.form-group textarea { resize: vertical; min-height: 60px; }

.file-input {
    margin-top: 6px; font-size: 13px;
}

.img-preview {
    margin-top: 8px;
}
.img-preview img {
    max-width: 160px; max-height: 80px; border-radius: 8px;
    border: 1px solid #e0e0e0;
}

/* =============== 列表项 =============== */
.list-item {
    border: 1px solid #f0f0f0; border-radius: 10px;
    padding: 18px; margin-bottom: 14px;
    background: #fafafa; transition: box-shadow .2s;
}
.list-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,.05); }

.list-item-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 14px; padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}
.list-item-header h4 { font-size: 14px; color: #7c3aed; }
.list-item-actions { display: flex; gap: 8px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Color picker inline */
.color-input-wrap {
    display: flex; align-items: center; gap: 8px;
}
.color-input-wrap input[type="color"] {
    width: 36px; height: 36px; border: 1px solid #e0e0e0;
    border-radius: 8px; cursor: pointer; padding: 2px;
}
.color-input-wrap input[type="text"] { flex: 1; }

/* =============== Tab Panels =============== */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* =============== Toast =============== */
.toast {
    position: fixed; top: 20px; right: 20px;
    padding: 12px 24px; border-radius: 10px;
    font-size: 14px; font-weight: 600; color: #fff;
    background: #10b981; z-index: 9999;
    transform: translateX(120%); transition: transform .3s;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
}
.toast.show { transform: translateX(0); }
.toast.error { background: #ef4444; }

/* =============== 响应式 =============== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .menu-btn { display: block; }
    .form-row { grid-template-columns: 1fr; }
    .topbar-actions { gap: 6px; }
    .btn { padding: 7px 12px; font-size: 12px; }
}

.empty-tip { color: #999; text-align: center; padding: 24px; font-size: 14px; }
