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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    color: #333;
    background-color: #f5f7fa;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ============ 登录页 ============ */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1e3a5f 0%, #2c5f8a 100%);
}

.login-box {
    background: #fff;
    border-radius: 8px;
    padding: 40px;
    width: 380px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.login-box h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #1e3a5f;
    font-size: 22px;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1e3a5f;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: #1e3a5f;
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: #1e3a5f;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-login:hover {
    background: #2c5f8a;
}

.error-msg {
    background: #fff2f0;
    border: 1px solid #ffccc7;
    color: #ff4d4f;
    padding: 8px 12px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 13px;
}

/* ============ 后台布局 ============ */
.admin-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    grid-template-rows: 56px 1fr;
    grid-template-areas:
        "header header"
        "sidebar content";
    min-height: 100vh;
}

/* 顶部导航 */
.admin-header {
    grid-area: header;
    background: #1e3a5f;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    z-index: 100;
}

.site-title {
    font-size: 18px;
    font-weight: 600;
}

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

.welcome-text {
    font-size: 13px;
    opacity: 0.9;
}

.btn-logout {
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    font-size: 13px;
    transition: background 0.3s;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* 侧边栏 */
.admin-sidebar {
    grid-area: sidebar;
    background: #fff;
    border-right: 1px solid #e8e8e8;
    position: fixed;
    top: 56px;
    left: 0;
    bottom: 0;
    width: 220px;
    overflow-y: auto;
}

.sidebar-nav ul {
    list-style: none;
    padding: 12px 0;
}

.sidebar-nav li {
    margin: 2px 0;
}

.nav-link {
    display: block;
    padding: 12px 24px;
    font-size: 14px;
    color: #555;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background: #f0f5ff;
    color: #1e3a5f;
}

.nav-link.active {
    background: #f0f5ff;
    color: #1e3a5f;
    border-left-color: #1e3a5f;
    font-weight: 500;
}

/* 侧边栏分组 */
.nav-group {
    margin-top: 8px;
}

.nav-group-title {
    display: block;
    padding: 10px 24px 6px;
    font-size: 12px;
    color: #999;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-submenu {
    padding: 0 !important;
}

.nav-submenu .nav-link {
    padding-left: 40px;
    font-size: 13px;
}

/* 内容区 */
.admin-content {
    grid-area: content;
    padding: 24px;
    margin-top: 56px;
    margin-left: 220px;
    min-height: calc(100vh - 56px);
}

.page-title {
    font-size: 20px;
    font-weight: 600;
    color: #1e3a5f;
    margin-bottom: 24px;
}

/* 统计卡片 */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border-left: 4px solid #1e3a5f;
}

.stat-card .card-title {
    font-size: 13px;
    color: #888;
    margin-bottom: 8px;
}

.stat-card .card-value {
    font-size: 28px;
    font-weight: 700;
    color: #1e3a5f;
}

.stat-card .card-desc {
    font-size: 12px;
    color: #aaa;
    margin-top: 6px;
}

/* 欢迎区块 */
.welcome-section {
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    margin-bottom: 24px;
}

.welcome-section h2 {
    color: #1e3a5f;
    margin-bottom: 10px;
}

.welcome-section p {
    color: #666;
    line-height: 1.6;
}

/* ============ 按钮 ============ */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    line-height: 1.5;
    font-family: inherit;
}

.btn-primary {
    background: #1e3a5f;
    color: #fff;
}
.btn-primary:hover {
    background: #2c5f8a;
    color: #fff;
}

.btn-danger {
    background: #ff4d4f;
    color: #fff;
}
.btn-danger:hover {
    background: #ff7875;
    color: #fff;
}

.btn-warning {
    background: #faad14;
    color: #fff;
}
.btn-warning:hover {
    background: #ffc53d;
    color: #fff;
}

.btn-outline {
    background: #fff;
    color: #1e3a5f;
    border: 1px solid #1e3a5f;
}
.btn-outline:hover {
    background: #f0f5ff;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

/* ============ 表格 ============ */
.admin-table-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
    overflow: hidden;
}

.admin-table-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.admin-table-card .card-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table thead th {
    background: #fafafa;
    padding: 12px 16px;
    text-align: left;
    font-weight: 500;
    color: #666;
    font-size: 13px;
    border-bottom: 1px solid #f0f0f0;
    white-space: nowrap;
}

.admin-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid #f5f5f5;
    font-size: 14px;
    color: #333;
}

.admin-table tbody tr:hover {
    background: #fafbff;
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

.text-ellipsis {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============ 徽章/标签 ============ */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.6;
}

.badge-success {
    background: #f6ffed;
    color: #52c41a;
    border: 1px solid #b7eb8f;
}

.badge-danger {
    background: #fff2f0;
    color: #ff4d4f;
    border: 1px solid #ffccc7;
}

.badge-warning {
    background: #fffbe6;
    color: #d48806;
    border: 1px solid #ffe58f;
}

.badge-info {
    background: #e6f7ff;
    color: #1890ff;
    border: 1px solid #91d5ff;
}

.badge-default {
    background: #f5f5f5;
    color: #999;
    border: 1px solid #d9d9d9;
}

.badge-telecom {
    background: #e6f7ff;
    color: #1890ff;
    border: 1px solid #91d5ff;
}

.badge-mobile {
    background: #f6ffed;
    color: #52c41a;
    border: 1px solid #b7eb8f;
}

.badge-unicom {
    background: #fff2f0;
    color: #ff4d4f;
    border: 1px solid #ffccc7;
}

.badge-guangdian {
    background: #fff7e6;
    color: #fa8c16;
    border: 1px solid #ffd591;
}

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

.filter-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-form .form-control {
    width: auto;
    min-width: 150px;
}

/* ============ 状态Tab ============ */
.status-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #e8e8e8;
}

.tab-link {
    display: inline-block;
    padding: 10px 20px;
    color: #666;
    font-size: 14px;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
    cursor: pointer;
}

.tab-link:hover {
    color: #1e3a5f;
}

.tab-link.active {
    color: #1e3a5f;
    border-bottom-color: #1e3a5f;
    font-weight: 500;
}

/* ============ 分页 ============ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 0;
}

.page-link {
    display: inline-block;
    padding: 6px 14px;
    background: #fff;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    color: #1e3a5f;
    font-size: 13px;
    transition: all 0.3s;
}

.page-link:hover {
    border-color: #1e3a5f;
    background: #f0f5ff;
}

.page-info {
    font-size: 13px;
    color: #888;
}

/* ============ 空状态 ============ */
.empty-state {
    padding: 60px 20px;
    text-align: center;
    color: #bbb;
    font-size: 14px;
}

/* ============ 详情表单 ============ */
.detail-form {
    padding: 24px;
}

.form-row {
    margin-bottom: 0;
}

.form-row.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 0;
}

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

.form-actions {
    margin-top: 20px;
    display: flex;
    gap: 12px;
}

.required {
    color: #ff4d4f;
}

/* ============ 订单详情 ============ */
.detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
}

.detail-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    padding: 20px 24px;
}

.detail-item {
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
}

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

.detail-label {
    display: block;
    font-size: 12px;
    color: #999;
    margin-bottom: 4px;
}

.detail-value {
    font-size: 14px;
    color: #333;
    word-break: break-all;
}

.text-muted {
    color: #aaa;
}
