/* Apple Style Design System - 蓝白清新主题 */
:root {
    /* 主色调 - 蓝白清新色系 */
    --primary-color: #007aff;       /* iOS Blue */
    --primary-hover: #0056cc;       /* Darker Blue */
    --primary-light: #4da6ff;       /* Light Blue */
    --primary-dark: #004499;        /* Dark Blue */
    --accent-color: #5ac8fa;        /* Sky Blue Accent */
    --accent-light: #85d7fb;        /* Light Sky Blue */
    
    /* 中性色调 */
    --bg-primary: #ffffff;          /* Pure White */
    --bg-secondary: #f8fafc;        /* Cool Light Gray */
    --bg-tertiary: #e2e8f0;         /* Cool Gray */
    --bg-elevated: #ffffff;         /* Pure White */
    
    /* 文本颜色 */
    --text-primary: #2d3436;        /* Dark Gray */
    --text-secondary: #636e72;      /* Medium Gray */
    --text-tertiary: #b2bec3;       /* Light Gray */
    --text-inverse: #ffffff;        /* White */
    
    /* 状态颜色 */
    --success-color: #00b894;       /* Teal Green */
    --warning-color: #fdcb6e;       /* Warm Yellow */
    --error-color: #e17055;         /* Coral Red */
    --info-color: #74b9ff;          /* Sky Blue */
    --gradient-primary: linear-gradient(135deg, #007aff 0%, #5ac8fa 100%);  /* Primary Gradient */
    --gradient-secondary: linear-gradient(135deg, #4da6ff 0%, #85d7fb 100%); /* Secondary Gradient */
    
    /* 阴影和边框 */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 16px 64px rgba(0, 0, 0, 0.16);
    
    /* 边框半径 */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-pill: 50px;
    
    /* 间距系统 */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;
    
    /* 字体系统 */
    --font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', system-ui, sans-serif;
    --font-mono: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    
    /* 简化动画曲线 */
    --ease-in-out: ease-in-out;
    --ease-out: ease-out;
    --ease-in: ease-in;
}

/* 全局重置和基础样式 */
* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--bg-secondary);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* 简化背景装饰 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.03) 0%, rgba(90, 200, 250, 0.02) 100%);
    z-index: -1;
    pointer-events: none;
}

/* 容器 - 网格布局 */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

/* 主要内容区域 - 分栏布局 */
.main-content {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    grid-template-rows: auto 1fr auto;
    gap: 40px;
    padding: 60px 0;
    position: relative;
}

/* 卡片系统 - 圆角矩形设计 */
.card {
    background: var(--bg-elevated);
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(255, 107, 53, 0.1), 0 4px 16px rgba(108, 92, 231, 0.05);
    border: 2px solid rgba(255, 107, 53, 0.08);
    margin-bottom: 24px;
    padding: 48px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(255, 107, 53, 0.12);
    border-color: rgba(255, 107, 53, 0.15);
}

.card-header {
    padding: 0 0 32px 0;
    border-bottom: 2px solid rgba(0, 122, 255, 0.1);
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.05) 0%, rgba(90, 200, 250, 0.03) 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin: -48px -48px 32px -48px;
    padding: 32px 48px;
    border-radius: 24px 24px 0 0;
}

.card-header h5 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card-body {
    padding: 0;
}

/* 按钮系统 - 现代胶囊设计 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    padding: var(--space-lg) var(--space-xl);
    font-family: var(--font-family);
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    border: none;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.02em;
    min-width: 140px;
    backdrop-filter: blur(10px);
}

.btn:hover {
    transform: translateY(-1px);
}

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

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* 主按钮 */
.btn-primary {
    background: var(--gradient-primary);
    color: var(--text-inverse);
    box-shadow: 0 8px 24px rgba(255, 107, 53, 0.25), 0 4px 12px rgba(108, 92, 231, 0.15);
    border: 2px solid transparent;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--accent-color) 100%);
    box-shadow: 0 6px 16px rgba(255, 107, 53, 0.25);
    transform: translateY(-2px);
}

/* 次要按钮 */
.btn-secondary {
    background: var(--bg-elevated);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    box-shadow: 0 4px 16px rgba(255, 107, 53, 0.1);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: var(--text-inverse);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.2);
    transform: translateY(-2px);
}

/* 小按钮 */
.btn-sm {
    padding: var(--space-sm) var(--space-md);
    font-size: 0.875rem;
    border-radius: var(--radius-lg);
}

/* 大按钮 */
.btn-lg {
    padding: var(--space-lg) var(--space-xl);
    font-size: 1.125rem;
    font-weight: 600;
}

/* 表格系统 */
.table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table thead th {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: var(--space-md) var(--space-lg);
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.table tbody td {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    vertical-align: middle;
}

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

.table tbody tr:hover {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.02) 0%, rgba(175, 82, 222, 0.01) 100%);
}

/* 表单控件 - 浮动标签设计 */
.form-group {
    margin-bottom: var(--space-xl);
    position: relative;
}

.form-label {
    position: absolute;
    top: 18px;
    left: 24px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 1rem;
    transition: all 0.3s ease;
    pointer-events: none;
    background: var(--bg-elevated);
    padding: 0 8px;
    z-index: 1;
}

.form-control {
    width: 100%;
    padding: 20px 24px;
    font-family: var(--font-family);
    font-size: 1.1rem;
    color: var(--text-primary);
    background: var(--bg-elevated);
    border: 2px solid rgba(255, 107, 53, 0.15);
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(255, 107, 53, 0.05);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.15), 0 8px 24px rgba(255, 107, 53, 0.1);
    background: var(--bg-elevated);
    transform: translateY(-2px);
}

.form-control:focus + .form-label,
.form-control:not(:placeholder-shown) + .form-label {
    top: -8px;
    left: 20px;
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 600;
}

.form-control::placeholder {
    color: transparent;
    opacity: 1;
}

/* 模态框 */
.modal-content {
    background: var(--bg-elevated);
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(20px);
}

.modal-header {
    padding: var(--space-lg);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.modal-body {
    padding: var(--space-lg);
}

.modal-footer {
    padding: var(--space-lg);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    display: flex;
    gap: var(--space-md);
    justify-content: flex-end;
}

/* 徽章系统 */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge.bg-success {
    background: var(--success-color);
    color: white;
}

.badge.bg-warning {
    background: var(--warning-color);
    color: white;
}

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

.badge.bg-info {
    background: var(--info-color);
    color: white;
}

/* 警告框 */
.alert {
    padding: var(--space-md);
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    margin-bottom: var(--space-md);
}

.alert-success {
    background: rgba(48, 209, 88, 0.1);
    border-color: rgba(48, 209, 88, 0.2);
    color: #1e5f2f;
}

.alert-warning {
    background: rgba(255, 193, 7, 0.1);
    border-color: rgba(255, 193, 7, 0.2);
    color: #856404;
}

.alert-danger {
    background: rgba(255, 69, 58, 0.1);
    border-color: rgba(255, 69, 58, 0.2);
    color: #7f1d1d;
}

.alert-info {
    background: rgba(0, 122, 255, 0.1);
    border-color: rgba(0, 122, 255, 0.2);
    color: #1e3a8a;
}

/* 工具类 */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.d-flex { display: flex; }
.d-block { display: block; }
.d-none { display: none; }
.d-inline-block { display: inline-block; }

.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-end { justify-content: flex-end; }

.align-items-center { align-items: center; }
.align-items-start { align-items: flex-start; }
.align-items-end { align-items: flex-end; }

.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }

.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-xs); }
.mb-2 { margin-bottom: var(--space-sm); }
.mb-3 { margin-bottom: var(--space-md); }
.mb-4 { margin-bottom: var(--space-lg); }
.mb-5 { margin-bottom: var(--space-xl); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-xs); }
.mt-2 { margin-top: var(--space-sm); }
.mt-3 { margin-top: var(--space-md); }
.mt-4 { margin-top: var(--space-lg); }
.mt-5 { margin-top: var(--space-xl); }

.p-2 { padding: var(--space-sm); }
.p-3 { padding: var(--space-md); }
.p-4 { padding: var(--space-lg); }

/* 颜色工具类 */
.text-primary { color: var(--primary-color) !important; }
.text-success { color: var(--success-color) !important; }
.text-warning { color: var(--warning-color) !important; }
.text-danger { color: var(--error-color) !important; }
.text-info { color: var(--info-color) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted { color: var(--text-tertiary) !important; }

/* 隐藏类 */
.hidden { display: none !important; }
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* 简化加载动画 */
.spinner-border {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 0.25em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: var(--space-md);
    }
    
    .card-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .card-body {
        padding: var(--space-md);
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: var(--space-md);
    }
    
    /* Input Group 移动端优化 */
    .input-group {
        flex-direction: row;
        align-items: stretch;
    }
    
    .input-group .input-group-text {
        border-radius: var(--radius-md) 0 0 var(--radius-md);
        border-right: none;
        background: var(--bg-tertiary);
        color: var(--text-secondary);
        padding: var(--space-sm) var(--space-md);
        min-width: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.875rem;
    }
    
    .input-group .form-control {
        border-radius: 0 var(--radius-md) var(--radius-md) 0;
        border-left: none;
        flex: 1;
    }
    
    .input-group .form-control:focus {
        box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
        border-color: var(--primary-color);
    }
}

@media (max-width: 576px) {
    .container {
        padding: var(--space-sm);
    }
    
    .card {
        border-radius: var(--radius-md);
    }
    
    .modal-content {
        border-radius: var(--radius-lg);
    }
    
    /* 超小屏幕 Input Group 优化 */
    .input-group .input-group-text {
        min-width: 40px;
        padding: var(--space-xs) var(--space-sm);
        font-size: 0.8rem;
    }
    
    .input-group .form-control {
        font-size: 0.875rem;
        padding: var(--space-xs) var(--space-sm);
    }
}

/* 页脚 */
.footer-modern {
    text-align: center;
    padding: var(--space-xl) 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    margin-top: var(--space-3xl);
}

/* 页面特定样式增强 */
.page-title {
    text-align: center;
    margin: var(--space-3xl) 0;
}

.page-title h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.page-title p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* 图标间距 */
.icon {
    margin-right: var(--space-sm);
}

/* 选择按钮特殊样式 */
.selection-button {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 2px solid rgba(0, 122, 255, 0.2);
    transition: all 0.3s var(--ease-out);
}

.selection-button:hover {
    background: var(--primary-color);
    color: var(--text-inverse);
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.2);
}

.selection-button.selected {
    background: var(--primary-color);
    color: var(--text-inverse);
    border-color: var(--primary-color);
}

/* 表格响应式 */
.table-responsive {
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

/* 链接样式 */
.text-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s var(--ease-out);
}

.text-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* 简化动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}