* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; background: #f0f2f5; color: #333; }
a { color: #1677ff; text-decoration: none; }
code { background: #f5f5f5; padding: 2px 6px; border-radius: 4px; font-size: 0.9em; }

.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #1677ff 0%, #0958d9 100%); }
.login-card { background: #fff; padding: 40px; border-radius: 12px; width: 100%; max-width: 400px; box-shadow: 0 8px 32px rgba(0,0,0,0.15); }
.login-card h1 { font-size: 24px; margin-bottom: 8px; }
.subtitle { color: #666; margin-bottom: 24px; }

.sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 220px; background: #001529; color: #fff; padding: 20px 0 0; display: flex; flex-direction: column; }
.sidebar .brand { padding: 0 20px 20px; font-size: 18px; font-weight: bold; border-bottom: 1px solid #ffffff20; margin-bottom: 10px; }
.sidebar-nav { flex: 1; overflow-y: auto; }
.sidebar a { display: block; padding: 12px 20px; color: #ffffffa6; }
.sidebar a:hover, .sidebar a.active { background: #1677ff; color: #fff; }
.sidebar-footer { padding: 12px; border-top: 1px solid #ffffff20; margin-top: auto; }
.sidebar-user-wrap { position: relative; }
.sidebar-user-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    background: #ffffff10;
    border: 1px solid #ffffff20;
    color: #fff;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    text-align: left;
}
.sidebar-user-btn:hover { background: #ffffff18; }
.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #1677ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
    text-transform: uppercase;
}
.user-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-arrow { font-size: 10px; color: #ffffff80; transition: transform 0.2s; }
.sidebar-user-wrap:has(.sidebar-user-menu.open) .user-arrow { transform: rotate(180deg); }
.sidebar-user-menu {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    z-index: 100;
}
.sidebar-user-menu.open { display: block; }
.user-menu-form { margin: 0; padding: 0; }
.user-menu-item {
    display: block;
    width: 100%;
    background: transparent;
    border: none;
    color: #333;
    padding: 12px 16px;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    border-radius: 0;
    text-decoration: none;
    line-height: 1.5;
    font-family: inherit;
}
.sidebar .sidebar-user-menu a.user-menu-item {
    color: #333;
    padding: 12px 16px;
    background: transparent;
}
.user-menu-item:hover, .user-menu-item.active,
.sidebar .sidebar-user-menu a.user-menu-item:hover,
.sidebar .sidebar-user-menu a.user-menu-item.active {
    background: #f5f5f5;
    color: #1677ff;
}

.content { margin-left: 220px; padding: 24px; }
.content h1 { margin-bottom: 24px; }

.card { background: #fff; border-radius: 8px; padding: 24px; margin-bottom: 20px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.channel-card h2 { margin-bottom: 16px; font-size: 16px; }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.stat-card { background: #fff; border-radius: 8px; padding: 24px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.stat-label { color: #666; font-size: 14px; }
.stat-value { font-size: 32px; font-weight: bold; color: #1677ff; margin-top: 8px; }

label { display: block; margin: 8px 0 4px; font-size: 14px; color: #666; }
input[type=text], input[type=password], input[type=url], input[type=number], select, textarea {
    width: 100%; padding: 8px 12px; border: 1px solid #d9d9d9; border-radius: 6px; font-size: 14px; margin-bottom: 8px;
}
button, .btn-primary { background: #1677ff; color: #fff; border: none; padding: 10px 20px; border-radius: 6px; cursor: pointer; font-size: 14px; }
button:hover, .btn-primary:hover { background: #0958d9; }
.btn-danger { background: #ff4d4f; }
.btn-danger:hover { background: #cf1322; }

.form-grid { max-width: 600px; }
.inline-form { display: inline-flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.inline-form input, .inline-form select { width: auto; min-width: 120px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 12px; border-bottom: 1px solid #f0f0f0; text-align: left; vertical-align: top; }
th { background: #fafafa; font-weight: 600; }

.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; }
.alert-error { background: #fff2f0; border: 1px solid #ffccc7; color: #cf1322; }
.alert-info { background: #e6f4ff; border: 1px solid #91caff; color: #0958d9; }
.hint { color: #666; margin-bottom: 16px; }

.status-success { color: #52c41a; font-weight: bold; }
.status-pending, .status-paying { color: #faad14; }
.status-failed, .status-closed { color: #ff4d4f; }

.pay-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: #f5f5f5; }
.pay-card { background: #fff; border-radius: 12px; padding: 32px; width: 100%; max-width: 420px; box-shadow: 0 4px 20px rgba(0,0,0,0.1); }
.pay-card h1 { text-align: center; margin-bottom: 24px; font-size: 20px; }
.order-info { text-align: center; margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid #f0f0f0; }
.order-info .subject { font-size: 16px; color: #333; }
.order-info .amount { font-size: 36px; font-weight: bold; color: #1677ff; margin: 12px 0; }
.order-info .order-no { font-size: 12px; color: #999; }
.channel-list { margin: 16px 0; }
.channel-item { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid #f0f0f0; border-radius: 8px; margin-bottom: 8px; cursor: pointer; }
.channel-item:hover { border-color: #1677ff; }
.btn-pay { width: 100%; padding: 14px; font-size: 16px; margin-top: 16px; }

/* 支付渠道 Tabs */
.tabs-card { padding: 0; overflow: hidden; }
.tabs-primary {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
    padding: 0 16px;
}
.tab-primary-btn {
    background: transparent;
    color: #666;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 500;
    border-radius: 0;
    margin-bottom: -1px;
}
.tab-primary-btn:hover { color: #1677ff; background: transparent; }
.tab-primary-btn.active {
    color: #1677ff;
    border-bottom-color: #1677ff;
    background: #fff;
}

.tabs-secondary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    background: #fff;
}
.tab-secondary-btn[hidden] { display: none !important; }
.tab-secondary-btn {
    background: #f5f5f5;
    color: #666;
    border: 1px solid transparent;
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.tab-secondary-btn:hover { color: #1677ff; border-color: #91caff; background: #e6f4ff; }
.tab-secondary-btn.active {
    background: #1677ff;
    color: #fff;
    border-color: #1677ff;
}
.tab-secondary-btn.active .tab-status.on { background: #ffffff30; color: #fff; }
.tab-secondary-btn.active .tab-status.off { background: #ffffff20; color: #fff; }
.tab-status {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
}
.tab-status.on { background: #f6ffed; color: #52c41a; }
.tab-status.off { background: #fff2f0; color: #ff4d4f; }

.tab-panels { padding: 24px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.tab-panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}
.tab-panel-header h2 { font-size: 18px; margin: 0; }
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    margin: 12px 0;
}
.checkbox-label input[type=checkbox] { width: auto; margin: 0; }
.form-actions { margin-top: 16px; padding-top: 16px; border-top: 1px solid #f0f0f0; }

/* 表格分页 */
.table-toolbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 16px;
}
.table-toolbar-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 12px 16px;
}
.table-summary { color: #666; font-size: 14px; white-space: nowrap; }
.page-size-form {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
    white-space: nowrap;
}
.page-size-form label { margin: 0; display: inline; }
.page-size-form select {
    width: auto;
    min-width: 64px;
    margin: 0;
    padding: 4px 8px;
    font-size: 13px;
    line-height: 1.4;
    height: 28px;
}
.empty-row { text-align: center; color: #999; padding: 32px !important; }
.table-row-clickable { cursor: pointer; }
.table-row-clickable:hover { background: #f0f7ff; }
.pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}
.pagination-inline {
    margin: 0;
    padding: 0;
    border: none;
}
.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    height: 28px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    color: #333;
    background: #fff;
    font-size: 13px;
    line-height: 1;
    box-sizing: border-box;
}
.page-btn:hover { color: #1677ff; border-color: #1677ff; }
.page-btn.disabled {
    color: #bbb;
    border-color: #eee;
    background: #fafafa;
    cursor: not-allowed;
}
.page-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    color: #333;
    background: #fff;
    font-size: 13px;
    box-sizing: border-box;
}
.page-num:hover { color: #1677ff; border-color: #1677ff; }
.page-num.active {
    color: #fff;
    background: #1677ff;
    border-color: #1677ff;
    cursor: default;
}
.page-info { font-size: 13px; color: #666; white-space: nowrap; }

/* 详情弹窗 */
.modal-dialog-wide { max-width: 720px; }
.detail-list { margin: 0; }
.detail-list dt {
    font-size: 13px;
    font-weight: 600;
    color: #888;
    margin-bottom: 4px;
}
.detail-list dd {
    margin: 0 0 16px;
    font-size: 14px;
    color: #333;
    word-break: break-all;
}
.detail-list dd:last-child { margin-bottom: 0; }
.detail-pre {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 12px;
    border-radius: 6px;
    overflow: auto;
    font-size: 12px;
    line-height: 1.5;
    max-height: 240px;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
}

/* 卡片头部 */
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.card-header-row h2 { margin: 0; }
.url-cell { max-width: 200px; word-break: break-all; font-size: 13px; color: #666; }
.secret-code { font-size: 12px; word-break: break-all; }
.actions-cell { white-space: nowrap; }
.actions-cell .inline-form { display: inline; }
.btn-link {
    background: transparent;
    color: #1677ff;
    border: none;
    padding: 4px 8px;
    font-size: 14px;
    cursor: pointer;
}
.btn-link:hover { color: #0958d9; background: transparent; }
.btn-danger-text { color: #ff4d4f !important; }
.btn-danger-text:hover { color: #cf1322 !important; }
.btn-secondary {
    background: #fff;
    color: #333;
    border: 1px solid #d9d9d9;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}
.btn-secondary:hover { color: #1677ff; border-color: #1677ff; }
.readonly-input { background: #f5f5f5; color: #666; cursor: not-allowed; }
.required { color: #ff4d4f; }

/* 弹窗 */
body.modal-open { overflow: hidden; }
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.modal.open { display: flex; }
.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}
.modal-dialog {
    position: relative;
    background: #fff;
    border-radius: 8px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    margin: 16px;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid #f0f0f0;
}
.modal-header h3 { margin: 0; font-size: 16px; }
.modal-close {
    background: transparent;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 0 4px;
}
.modal-close:hover { color: #333; background: transparent; }
.modal-body { padding: 20px 24px; }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #f0f0f0;
}
.modal-form .form-grid { max-width: none; margin: 0; }



