/* ============================================================
   黑奥秘后台管理系统 - 全局样式
   参照原型图设计：青绿色系 + 左侧导航 + 顶部栏
   ============================================================ */

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

:root {
    --brand-teal: #2A9D8F;
    --brand-teal-dark: #238B7E;
    --brand-teal-light: #5FC5B8;
    --brand-gray: #264653;
    --text-primary: #4A4A4A;
    --text-secondary: #8C8C8C;
    --text-disabled: #BDBDBD;
    --brand-black: #1A1A1A;
    --border-gray: #E8E8E8;
    --white: #FFFFFF;
    --success: #52C41A;
    --warning: #FAAD14;
    --error: #F5222D;
    --info: #1890FF;
    --bg-page: #F5F7FA;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.6;
}

/* ========== 整体布局 ========== */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ========== 左侧导航 ========== */
.sidebar {
    width: 240px;
    background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
    border-right: 1px solid #e8ecef;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.03);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    flex-shrink: 0;
    z-index: 100;
}

.logo {
    padding: 24px;
    border-bottom: 1px solid var(--border-gray);
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    position: relative;
}

.logo::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 24px;
    right: 24px;
    height: 3px;
    background: linear-gradient(90deg, var(--brand-teal), var(--brand-teal-light));
    border-radius: 2px 2px 0 0;
}

.logo-image {
    width: 56px;
    height: 56px;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(42, 157, 143, 0.15));
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.logo:hover .logo-image {
    transform: scale(1.05);
    filter: drop-shadow(0 4px 12px rgba(42, 157, 143, 0.25));
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--brand-teal), var(--brand-teal-dark));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(42, 157, 143, 0.25);
    transition: all 0.3s ease;
}

.logo:hover .logo-icon {
    transform: rotate(-5deg) scale(1.05);
    box-shadow: 0 6px 16px rgba(42, 157, 143, 0.35);
}

.logo-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--brand-gray);
    letter-spacing: 1px;
    line-height: 1.2;
}

.logo-sub {
    font-size: 11px;
    color: var(--brand-teal);
    font-weight: 500;
    letter-spacing: 0.5px;
}

.logo-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--brand-gray);
}

.logo-sub {
    font-size: 11px;
    color: var(--text-secondary);
}

.nav-section {
    padding: 16px 12px;
}

.nav-section + .nav-section {
    border-top: 1px solid #F0F0F0;
    padding-top: 16px;
}

.nav-title {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 12px;
    margin-bottom: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin: 4px 12px;
    border-radius: 10px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    font-size: 14px;
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(90deg, var(--brand-teal), var(--brand-teal-light));
    transition: width 0.3s ease;
    border-radius: 10px 0 0 10px;
}

.nav-item:hover {
    background: linear-gradient(135deg, #f0f9f8 0%, #e8f5f3 100%);
    color: var(--brand-teal);
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(42, 157, 143, 0.1);
}

.nav-item:hover::before {
    width: 4px;
}

.nav-item.active {
    background: linear-gradient(135deg, var(--brand-teal) 0%, var(--brand-teal-dark) 100%);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(42, 157, 143, 0.3);
    transform: translateX(4px);
}

.nav-item.active::before {
    width: 4px;
    background: rgba(255, 255, 255, 0.3);
}
    height: 20px;
    background: var(--white);
    border-radius: 0 2px 2px 0;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.nav-badge {
    margin-left: auto;
    background: var(--error);
    color: var(--white);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
}

/* ========== 主内容区 ========== */
.main-content {
    flex: 1;
    margin-left: 240px;
    min-width: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* ========== 顶部栏 ========== */
.topbar {
    background: var(--white);
    border-bottom: 1px solid var(--border-gray);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 99;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.page-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--brand-gray);
}

.breadcrumb {
    font-size: 13px;
    color: var(--text-secondary);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-box {
    display: flex;
    align-items: center;
    background: #F5F7FA;
    border-radius: 8px;
    padding: 8px 16px;
    gap: 8px;
}

.search-box input {
    border: none;
    background: transparent;
    outline: none;
    width: 200px;
    font-size: 14px;
}

.search-box i {
    color: var(--text-secondary);
}

.topbar-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.topbar-icon:hover {
    background: #F5F7FA;
    color: var(--brand-teal);
}

.topbar-icon .badge-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--error);
    border-radius: 50%;
    border: 2px solid var(--white);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-teal), var(--brand-teal-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

/* ========== 内容区 ========== */
.content {
    padding: 32px;
    flex: 1;
    overflow-y: auto;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

/* ========== 统计卡片 ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--white);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border-gray);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: all 0.2s;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-icon.teal { background: rgba(42, 157, 143, 0.1); color: var(--brand-teal); }
.stat-icon.success { background: rgba(82, 196, 26, 0.1); color: var(--success); }
.stat-icon.warning { background: rgba(250, 173, 20, 0.1); color: var(--warning); }
.stat-icon.error { background: rgba(245, 34, 45, 0.1); color: var(--error); }
.stat-icon.info { background: rgba(24, 144, 255, 0.1); color: var(--info); }

.stat-trend {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
}

.stat-trend.up { background: rgba(82, 196, 26, 0.1); color: var(--success); }
.stat-trend.down { background: rgba(245, 34, 45, 0.1); color: var(--error); }

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--brand-gray);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ========== 卡片 ========== */
.card {
    background: var(--white);
    border-radius: 12px;
    border: 1px solid var(--border-gray);
    margin-bottom: 32px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: box-shadow 0.2s;
}

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

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--brand-gray);
}

.card-body {
    padding: 20px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--brand-gray);
    margin: 0;
}

/* ========== 按钮 ========== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--brand-teal);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--brand-teal-dark);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(42, 157, 143, 0.2);
}

.btn:active {
    transform: scale(0.98);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--brand-teal);
    color: var(--brand-teal);
}

.btn-outline:hover {
    background: rgba(42, 157, 143, 0.05);
}

.btn-text {
    background: transparent;
    color: var(--brand-teal);
    padding: 4px 8px;
}

.btn-text:hover {
    background: rgba(42, 157, 143, 0.05);
    border-radius: 4px;
}

.btn-danger {
    background: var(--error);
    color: var(--white);
}

.btn-danger:hover {
    background: #cf1124;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 13px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========== 输入框 ========== */
.input, select.input {
    padding: 10px 14px;
    border: 1px solid var(--border-gray);
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
    background: var(--white);
    color: var(--text-primary);
}

.input:focus {
    border-color: var(--brand-teal);
    box-shadow: 0 0 0 4px rgba(42, 157, 143, 0.12);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-sm {
    padding: 6px 10px;
    font-size: 13px;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-row:has(.form-group:only-child) {
    grid-template-columns: 1fr;
}

.modal-form label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.modal-form input,
.modal-form select,
.modal-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-gray);
    border-radius: 6px;
    font-size: 14px;
}

.modal-form input:focus,
.modal-form select:focus,
.modal-form textarea:focus {
    outline: none;
    border-color: var(--brand-teal);
}

.required {
    color: var(--error);
}

/* ========== 表格 ========== */
.table-wrapper {
    overflow-x: auto;
}

.table, .data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.data-table {
    overflow-x: auto;
}

.table th, .data-table th {
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-gray);
    white-space: nowrap;
    background: #FAFBFC;
}

.table td, .data-table td {
    padding: 16px 16px;
    border-bottom: 1px solid var(--border-gray);
    font-size: 14px;
    vertical-align: middle;
}

.table tr:last-child td, .data-table tr:last-child td {
    border-bottom: none;
}

.table tr:hover td, .data-table tr:hover td {
    background: #F0F9F8;
    transition: background 0.15s;
}

.table-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ========== 状态标签 ========== */
.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.status.success { background: rgba(82, 196, 26, 0.1); color: var(--success); }
.status.warning { background: rgba(250, 173, 20, 0.1); color: var(--warning); }
.status.error { background: rgba(245, 34, 45, 0.1); color: var(--error); }
.status.info { background: rgba(24, 144, 255, 0.1); color: var(--info); }
.status.neutral { background: #F0F0F0; color: var(--text-secondary); }
.status.teal { background: rgba(42, 157, 143, 0.1); color: var(--brand-teal); }

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

/* ========== 分页 ========== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-top: 1px solid var(--border-gray);
    flex-wrap: wrap;
    gap: 12px;
}

.pagination-container {
    padding: 16px 20px;
    border-top: 1px solid var(--border-gray);
}

.pagination-info {
    font-size: 13px;
    color: var(--text-secondary);
}

.pagination-buttons {
    display: flex;
    gap: 4px;
}

.page-btn {
    min-width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--border-gray);
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s;
    padding: 0 8px;
}

.page-btn:hover {
    border-color: var(--brand-teal);
    color: var(--brand-teal);
}

.page-btn.active {
    background: var(--brand-teal);
    border-color: var(--brand-teal);
    color: var(--white);
}

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

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ========== 模态框 ========== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.2s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    background: var(--white);
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-gray);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--brand-gray);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    border: none;
    background: transparent;
    font-size: 16px;
}

.modal-close:hover {
    background: #F5F7FA;
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-gray);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ========== 空状态 ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state p {
    font-size: 14px;
}

/* ========== Toast 提示 ========== */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--white);
    border-radius: 8px;
    padding: 14px 18px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    min-width: 280px;
    animation: toastIn 0.3s ease;
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--error); }
.toast.warning { border-left: 4px solid var(--warning); }
.toast.info { border-left: 4px solid var(--info); }

@keyframes toastIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ========== 加载 ========== */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: var(--text-secondary);
    gap: 10px;
}

.loading i {
    font-size: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ========== 响应式 ========== */
@media (max-width: 1200px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ========== 两列布局 ========== */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 900px) {
    .grid-2 { grid-template-columns: 1fr; }
}

/* ========== 进度条 ========== */
.progress-bar {
    height: 8px;
    background: #F0F0F0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s;
}

.progress-fill.teal { background: linear-gradient(90deg, var(--brand-teal), var(--brand-teal-light)); }

/* ========== 搜索过滤 ========== */
.filter-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.filter-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.filter-input {
    padding: 8px 12px;
    border: 1px solid var(--border-gray);
    border-radius: 6px;
    font-size: 14px;
    min-width: 140px;
}

.filter-input:focus {
    outline: none;
    border-color: var(--brand-teal);
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid var(--border-gray);
    border-radius: 6px;
    font-size: 14px;
    background: var(--white);
    min-width: 120px;
}

/* ========== 金额显示 ========== */
.amount {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.amount.positive { color: var(--success); }
.amount.negative { color: var(--error); }

/* ========== 支付方式 ========== */
.payment-method {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border: 2px solid var(--border-gray);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--white);
    font-size: 14px;
    color: var(--text-primary);
}

.payment-method:hover {
    border-color: var(--brand-teal);
    color: var(--brand-teal);
}

.payment-method.active {
    border-color: var(--brand-teal);
    background: rgba(42, 157, 143, 0.1);
    color: var(--brand-teal);
}

/* ========== 详情表格 ========== */
.detail-table {
    border-collapse: collapse;
    width: 100%;
}

.detail-table th,
.detail-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-gray);
}

.detail-table th {
    background: #fafafa;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 12px;
}

.detail-table tbody tr:hover {
    background: #fafafa;
}

/* ========== 详情网格 ========== */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-item.full {
    grid-column: 1 / -1;
}

.detail-item label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.detail-item div {
    font-size: 14px;
    color: var(--text-primary);
}

/* ========== 散客开单按钮 ========== */
#from-booking-btn {
    background: var(--brand-teal);
    border-color: var(--brand-teal);
}

#from-booking-btn:hover {
    background: var(--brand-teal-dark);
    border-color: var(--brand-teal-dark);
}

/* ========== 响应式适配 ========== */

/* 平板适配 */
@media (max-width: 1024px) {
    .sidebar {
        width: 200px;
    }
    
    .main-content {
        margin-left: 200px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .content {
        padding: 24px;
    }
}

/* 移动端适配 */
@media (max-width: 768px) {
    .sidebar {
        width: 240px;
        transform: translateX(-100%);
        transition: transform 0.3s;
        box-shadow: 2px 0 8px rgba(0,0,0,0.1);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .topbar {
        padding: 12px 16px;
    }
    
    .page-title {
        font-size: 18px;
    }
    
    .content {
        padding: 16px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-row,
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-row .input,
    .filter-row .btn,
    .filter-bar .input,
    .filter-bar .btn {
        width: 100%;
    }
    
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .card {
        margin-bottom: 16px;
    }
    
    .modal {
        max-width: 100%;
        margin: 0;
    }
}

/* ========================================
   权限分配样式
   ======================================== */
.permission-assign-container {
    max-height: 60vh;
    overflow-y: auto;
}

.permission-tree {
    border: 1px solid #E8E8E8;
    border-radius: 8px;
    padding: 16px;
    background: #FAFAFA;
}

.permission-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.permission-list .permission-list {
    margin-left: 24px;
    border-left: 1px dashed #D9D9D9;
    padding-left: 12px;
}

.permission-item {
    padding: 6px 0;
}

.permission-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.permission-label:hover {
    background: rgba(24, 144, 255, 0.08);
}

.perm-cb {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.perm-name {
    font-weight: 500;
    color: #262626;
}

.perm-code {
    font-size: 12px;
    color: #8C8C8C;
    font-family: monospace;
}

.permission-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    justify-content: flex-end;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 12px;
    background: #E6F7FF;
    color: #1890FF;
    border-radius: 10px;
}

/* ========== 仪表盘专用样式 ========== */
.dashboard-welcome {
    margin-bottom: 32px;
}

.dashboard-welcome h2 {
    font-size: 28px;
    font-weight: 600;
    color: var(--brand-gray);
    margin: 0;
}

.dashboard-welcome p {
    margin: 0;
}

/* ========== 会员选择器样式 ========== */
.selected-member-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #F0F9F8;
    border: 2px solid var(--brand-teal);
    border-radius: 8px;
}

.member-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-teal), var(--brand-teal-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 18px;
    font-weight: 600;
    flex-shrink: 0;
}

.member-avatar-sm {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-teal), var(--brand-teal-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: var(--white);
    border: 1px solid var(--border-gray);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    max-height: 320px;
    overflow-y: auto;
    z-index: 100;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s;
}

.search-result-item:hover {
    background: #F0F9F8;
}

.search-result-item:not(:last-child) {
    border-bottom: 1px solid var(--border-gray);
}

.search-loading,
.search-empty {
    padding: 16px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
}

/* ========== 输入框组合 ========== */
.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-prefix {
    position: absolute;
    left: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    pointer-events: none;
}

.input-group .input {
    padding-left: 32px;
}

/* ========== 表单网格布局 ========== */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.form-item {
    display: flex;
    flex-direction: column;
}

.form-item.full {
    grid-column: 1 / -1;
}

.form-item label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-item label .required,
.form-item label::after {
    color: var(--error);
}

.form-item .hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-item.full {
        grid-column: 1;
    }
}

/* ========== 底部操作栏 ========== */
.action-bar {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 24px -32px -32px;
    padding: 16px 32px;
    background: #F0F9F8;
    border-top: 1px solid var(--brand-teal);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 100;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
}

/* 确保在短页面时也能固定在底部 */
#page-content {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#page-content > .card:last-of-type {
    flex: 1;
}
