* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: #fafbfc;
    color: #333;
    font-size: 14px;
    line-height: 1.6;
}
a { color: #b1ce48; text-decoration: none; }
a:hover { color: #96b33a; }

/* 登录页面 */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7f0 0%, #e8edda 100%);
}
.login-box {
    background: #fff;
    border-radius: 16px;
    padding: 48px 40px;
    width: 400px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
    text-align: center;
}
.login-box h1 {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}
.login-box .subtitle {
    color: #999;
    font-size: 13px;
    margin-bottom: 32px;
}
.login-box .form-group {
    margin-bottom: 20px;
    text-align: left;
}
.login-box label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
}
.login-box input[type="text"],
.login-box input[type="password"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
    outline: none;
}
.login-box input:focus {
    border-color: #b1ce48;
}
.login-box .btn-login {
    width: 100%;
    padding: 12px;
    background: #b1ce48;
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 8px;
}
.login-box .btn-login:hover {
    background: #96b33a;
}
.login-error {
    color: #e74c3c;
    font-size: 13px;
    margin-bottom: 16px;
    background: #fef0f0;
    padding: 8px 12px;
    border-radius: 6px;
}

/* 布局 */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: 240px;
    background: #fff;
    border-right: 1px solid #eee;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
}
.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
}
.sidebar-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}
.logo-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: #b1ce48;
    border-radius: 50%;
    margin-right: 8px;
}
/* 站点切换器 */
.site-switcher {
    display: flex;
    margin: 16px 20px 0;
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
}
.site-switcher a {
    flex: 1;
    text-align: center;
    padding: 8px 0;
    font-size: 13px;
    color: #666;
    transition: all 0.2s;
}
.site-switcher a.active {
    background: #b1ce48;
    color: #fff;
}
.site-switcher a:hover:not(.active) {
    background: #eee;
    color: #333;
}

/* 导航菜单 */
.sidebar-nav {
    flex: 1;
    padding: 8px 0;
    overflow-y: auto;
}

/* 分组 */
.nav-group {
    margin-bottom: 4px;
}
.nav-group-title {
    display: flex;
    align-items: center;
    padding: 8px 20px;
    font-size: 12px;
    font-weight: 600;
    color: #999;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s;
}
.nav-group-title:hover {
    color: #666;
}
.group-toggle {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    border-radius: 4px;
    margin-right: 8px;
    font-size: 12px;
    color: #888;
    font-weight: 600;
    transition: all 0.15s;
}
.nav-group-title:hover .group-toggle {
    background: #e0e0e0;
}
.group-name {
    flex: 1;
}

/* 分组内的菜单项 */
.nav-group-items {
    overflow: hidden;
    max-height: 500px;
    transition: max-height 0.2s ease-out;
}
.nav-group.collapsed .nav-group-items {
    max-height: 0;
}
.nav-group.collapsed .group-toggle {
    background: #f5f5f5;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 8px 20px 8px 46px;
    color: #666;
    font-size: 13px;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}
.sidebar-nav a:hover {
    background: #f8f9f6;
    color: #333;
}
.sidebar-nav a.active {
    background: #f5f8ee;
    color: #b1ce48;
    border-left-color: #b1ce48;
    font-weight: 500;
}
.sidebar-nav .nav-icon {
    width: 20px;
    margin-right: 10px;
    text-align: center;
    font-size: 14px;
    color: #aaa;
    font-weight: 400;
    transition: color 0.15s;
}
.sidebar-nav a:hover .nav-icon,
.sidebar-nav a.active .nav-icon {
    color: #b1ce48;
}

/* 侧边栏底部 */
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid #f0f0f0;
}
.sidebar-footer a {
    color: #999;
    font-size: 13px;
}
.sidebar-footer a:hover {
    color: #e74c3c;
}

/* 主内容区 */
.main-content {
    margin-left: 240px;
    flex: 1;
    min-height: 100vh;
}

/* 顶部栏 */
.topbar {
    background: #fff;
    border-bottom: 1px solid #eee;
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
}
.topbar h1 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}
.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}
.topbar-right .admin-name {
    font-size: 13px;
    color: #666;
}
.topbar-right .current-site {
    background: #f5f8ee;
    color: #b1ce48;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

/* 内容区 */
.content-area {
    padding: 24px 32px;
}

/* 通用卡片 */
.card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}


/* 通用按钮 */
.btn {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-weight: 500;
}
.btn-primary {
    background: #b1ce48;
    color: #fff;
}
.btn-primary:hover {
    background: #96b33a;
}
.btn-success {
    background: #27ae60;
    color: #fff;
}
.btn-success:hover {
    background: #219a52;
}
.btn-danger {
    background: #e74c3c;
    color: #fff;
}
.btn-danger:hover {
    background: #c0392b;
}
.btn-warning {
    background: #f39c12;
    color: #fff;
}
.btn-warning:hover {
    background: #d68910;
}
.btn-outline {
    background: transparent;
    border: 1px solid #ddd;
    color: #666;
}
.btn-outline:hover {
    border-color: #b1ce48;
    color: #b1ce48;
}
.btn-sm {
    padding: 4px 12px;
    font-size: 12px;
}

/* 状态标签 */
.status-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}
.sale-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}
.status-pending {
    background: #fff3cd;
    color: #856404;
}
.status-approved {
    background: #d4edda;
    color: #155724;
}
.status-rejected {
    background: #f8d7da;
    color: #721c24;
}
.status-active {
    background: #d4edda;
    color: #155724;
}
.status-disabled {
    background: #f8d7da;
    color: #721c24;
}

/* Tab 切换 */
.tabs {
    display: flex;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 20px;
}
.tabs a {
    padding: 10px 20px;
    color: #666;
    font-size: 14px;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}
.tabs a:hover {
    color: #333;
}
.tabs a.active {
    color: #b1ce48;
    border-bottom-color: #b1ce48;
    font-weight: 500;
}

/* 搜索框 */
.search-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    align-items: center;
}
.search-bar input[type="text"],
.search-bar select {
    padding: 8px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}
.search-bar input:focus,
.search-bar select:focus {
    border-color: #b1ce48;
}
.search-bar input[type="text"] {
    width: 260px;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin-top: 20px;
}
.pagination a,
.pagination span {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    color: #666;
}
.pagination a:hover {
    background: #f5f8ee;
    color: #b1ce48;
}
.pagination .active {
    background: #b1ce48;
    color: #fff;
}
.pagination .disabled {
    color: #ccc;
    cursor: default;
}

/* ===== 统一弹窗系统 ===== */

/* 编辑模态框（统一 .modal = 遮罩 + .modal-content = 内容） */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.modal.show {
    display: flex;
}
.modal-content {
    background: #fff;
    border-radius: 12px;
    width: 520px;
    max-width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
    animation: modalSlideIn 0.2s ease;
}
.modal-wide .modal-content {
    width: 680px;
}
@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-20px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
}
.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.15s;
}
.modal-close:hover {
    color: #333;
}
.modal-body {
    padding: 24px;
}
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* 确认弹窗（小型，居中带图标） */
.confirm-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.45);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}
.confirm-overlay.show {
    display: flex;
}
.confirm-dialog {
    background: #fff;
    border-radius: 16px;
    width: 420px;
    max-width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.18);
    overflow: hidden;
    animation: modalSlideIn 0.2s ease;
}
.confirm-body {
    padding: 36px 28px 24px;
    text-align: center;
}
.confirm-icon {
    font-size: 48px;
    margin-bottom: 16px;
    line-height: 1;
}
.confirm-icon.warn { color: #f59e0b; }
.confirm-icon.danger { color: #e55c5c; }
.confirm-msg {
    font-size: 15px;
    color: #333;
    line-height: 1.7;
    white-space: pre-line;
}
.confirm-actions {
    display: flex;
    border-top: 1px solid #f0f0f0;
}
.confirm-actions button {
    flex: 1;
    padding: 14px;
    border: none;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.confirm-btn-cancel {
    background: #fff;
    color: #999;
    border-right: 1px solid #f0f0f0 !important;
    border-radius: 0 0 0 16px;
}
.confirm-btn-cancel:hover {
    color: #666;
    background: #fafafa;
}
.confirm-btn-ok {
    background: #fff;
    color: #b1ce48;
    font-weight: 600;
    border-radius: 0 0 16px 0;
}
.confirm-btn-ok:hover {
    background: #f8fcf0;
}
.confirm-btn-ok.danger {
    color: #e55c5c;
}
.confirm-btn-ok.danger:hover {
    background: #fef5f5;
}

/* 表单 */
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
    font-weight: 500;
}
.required {
    color: #ef4444;
}
.form-row {
    display: flex;
    gap: 16px;
}
.form-row .form-group {
    flex: 1;
}
.form-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s;
}
.form-input:focus {
    border-color: #b1ce48;
}
.form-input:disabled {
    background: #f5f5f5;
    color: #999;
}
textarea.form-input {
    resize: vertical;
    min-height: 80px;
}
select.form-input {
    cursor: pointer;
}
.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="url"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #b1ce48;
}
.form-group textarea {
    resize: vertical;
    min-height: 80px;
}
.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* 统一美化下拉选择器 - 覆盖浏览器默认样式 */
select.form-input,
.search-bar select,
.form-group select {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-color: #fff !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 10px center !important;
    background-size: 12px !important;
    padding-right: 32px !important;
    cursor: pointer;
}

select.form-input:hover,
.search-bar select:hover,
.form-group select:hover {
    border-color: #b1ce48;
}

/* Firefox 特殊处理 */
select.form-input::-ms-expand,
.search-bar select::-ms-expand,
.form-group select::-ms-expand {
    display: none;
}

/* 统计卡片 */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.stat-card .stat-label {
    font-size: 13px;
    color: #999;
    margin-bottom: 8px;
}
.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #333;
}
.stat-card .stat-icon {
    float: right;
    font-size: 24px;
    color: #b1ce48;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}
.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

/* 提示消息 */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
}
.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}
.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* 工具栏 */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
