/*
 * 苹果设计风格CSS
 * 简洁精致，简洁的配色和圆角设计
 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #f0f4f8 100%);
    color: #1d1d1f;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 登录页面 */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    padding: 36px;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 380px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 16px;
}

.login-title {
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 24px;
    color: #1d1d1f;
}

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

.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #6e6e73;
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #f5f5f7;
}

.form-input:focus {
    outline: none;
    border-color: #007aff;
    background: white;
    box-shadow: 0 0 0 3px rgba(0,122,255,0.1);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    line-height: 1.5;
    height: 40px;
}

.btn-primary {
    background: #007aff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.btn-success {
    background: #34c759;
    color: white;
}

.btn-success:hover {
    background: #28a745;
}

.btn-warning {
    background: #ff9500;
    color: white;
}

.btn-warning:hover {
    background: #e68600;
}

.btn-danger {
    background: #ff3b30;
    color: white;
}

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

.btn-secondary {
    background: #8e8e93;
    color: white;
}

.btn-secondary:hover {
    background: #6c757d;
}

.btn-info {
    background: #5ac8fa;
    color: white;
}

.btn-info:hover {
    background: #4aa8d4;
}

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

.sidebar {
    width: 240px;
    background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
    box-shadow: 2px 0 15px rgba(0,0,0,0.06);
    padding: 15px 0;
    position: relative;
    overflow: hidden;
    border-right: 1px solid #e0e0e0;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #007aff, #5856d6, #af52de, #ff2d55);
}

.logo {
    padding: 18px 15px;
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    letter-spacing: 1px;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 15px;
}

.nav-menu {
    list-style: none;
    padding: 0 8px;
}

.nav-item {
    margin-bottom: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    color: #5f6368;
    text-decoration: none;
    font-weight: 500;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: rgba(0,122,255,0.08);
    color: #007aff;
    transform: translateX(4px);
}

.nav-link.active {
    background: linear-gradient(135deg, #007aff, #5856d6);
    color: white;
    box-shadow: 0 4px 15px rgba(0,122,255,0.25);
}

.nav-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.main-content {
    flex: 1;
    padding: 20px 24px;
}

.page-header {
    margin-bottom: 20px;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: #1d1d1f;
}

/* 卡片 */
.card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    margin-bottom: 18px;
    border: 1px solid rgba(0,0,0,0.03);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.card-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(0,122,255,0.1), rgba(88,86,214,0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.card-title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 0;
    color: #1d1d1f;
}

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

.table th,
.table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #e5e5ea;
}

.table th {
    font-weight: 600;
    color: #6e6e73;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody tr:hover {
    background: #f5f5f7;
}

/* 状态标签 */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: #d4fdd8;
    color: #34c759;
}

.badge-warning {
    background: #fff3cd;
    color: #ff9500;
}

.badge-danger {
    background: #ffe5e5;
    color: #ff3b30;
}

.badge-info {
    background: #e3f2fd;
    color: #1976d2;
}

/* 表单 */
.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.form-col {
    flex: 1;
}

/* 按钮组 */
.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.btn-group form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-group .form-input {
    width: 150px;
    flex-shrink: 0;
}

.btn-small {
    padding: 6px 14px;
    font-size: 13px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.5;
}

/* 提示消息 */
.alert {
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.alert-success {
    background: #d4fdd8;
    color: #34c759;
}

.alert-error {
    background: #ffe5e5;
    color: #ff3b30;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 16px 16px 0 0;
}

.stat-card:nth-child(1)::before {
    background: linear-gradient(90deg, #007aff, #5856d6);
}

.stat-card:nth-child(2)::before {
    background: linear-gradient(90deg, #34c759, #30d158);
}

.stat-card:nth-child(3)::before {
    background: linear-gradient(90deg, #ff9500, #ff3b30);
}

.stat-card:nth-child(4)::before {
    background: linear-gradient(90deg, #5856d6, #af52de);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}

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

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-card:nth-child(1) .stat-icon {
    background: linear-gradient(135deg, rgba(0,122,255,0.1), rgba(88,86,214,0.1));
}

.stat-card:nth-child(2) .stat-icon {
    background: linear-gradient(135deg, rgba(52,199,89,0.1), rgba(48,209,88,0.1));
}

.stat-card:nth-child(3) .stat-icon {
    background: linear-gradient(135deg, rgba(255,149,0,0.1), rgba(255,59,48,0.1));
}

.stat-card:nth-child(4) .stat-icon {
    background: linear-gradient(135deg, rgba(88,86,214,0.1), rgba(175,82,222,0.1));
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 6px;
}

.stat-label {
    font-size: 14px;
    color: #6e6e73;
    font-weight: 500;
}

.stat-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #34c759;
    margin-top: 10px;
}

/* 会员编辑页面专用样式 */
.card-section {
    background: linear-gradient(135deg, #fafbfc 0%, #ffffff 100%);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    border: 1px solid rgba(0,0,0,0.03);
}

.card-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f0f0f5;
}

.card-section-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.card-section-icon.primary {
    background: linear-gradient(135deg, rgba(0,122,255,0.15), rgba(88,86,214,0.15));
}

.card-section-icon.cache {
    background: linear-gradient(135deg, rgba(255,149,0,0.15), rgba(255,59,48,0.15));
}

.card-section-icon.info {
    background: linear-gradient(135deg, rgba(52,199,89,0.15), rgba(48,209,88,0.15));
}

.card-section-title {
    font-size: 18px;
    font-weight: 700;
    color: #1d1d1f;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.info-item {
    background: #f8f9fa;
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.info-label {
    font-size: 12px;
    color: #8e8e93;
    font-weight: 500;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.info-value {
    font-size: 15px;
    color: #1d1d1f;
    font-weight: 600;
}

.cache-editor {
    background: #f5f5f7;
    border: 1px solid #e5e5ea;
    border-radius: 12px;
    padding: 16px;
    margin-top: 8px;
}

.cache-textarea {
    width: 100%;
    min-height: 150px;
    padding: 12px 14px;
    border: 1px solid #d2d2d7;
    border-radius: 10px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    background: white;
    resize: vertical;
    transition: all 0.3s ease;
}

.cache-textarea:focus {
    outline: none;
    border-color: #007aff;
    box-shadow: 0 0 0 3px rgba(0,122,255,0.1);
}

.quick-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.quick-btn {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 8px;
    border: 1px solid #d2d2d7;
    background: white;
    color: #1d1d1f;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.quick-btn:hover {
    background: #f5f5f7;
    border-color: #007aff;
    transform: translateY(-1px);
}

.quick-btn:active {
    transform: translateY(0);
}

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

.action-buttons {
    display: flex;
    gap: 12px;
}

.btn-large {
    padding: 12px 24px;
    font-size: 15px;
    height: 44px;
}

.cache-preview {
    background: #1d1d1f;
    color: #f5f5f7;
    padding: 16px;
    border-radius: 10px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.7;
    overflow-x: auto;
    max-height: 300px;
    overflow-y: auto;
}

.cache-preview .json-key {
    color: #5ac8fa;
}

.cache-preview .json-string {
    color: #ff9f0a;
}

.cache-preview .json-number {
    color: #30d158;
}
