/* 全局样式 */
* {
    box-sizing: border-box;
}

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #48bb78;
    --warning-color: #ed8936;
    --danger-color: #f56565;
    --gray-light: #f7fafc;
    --gray-medium: #e2e8f0;
    --gray-dark: #4a5568;
    --text-color: #2d3748;
    --border-radius: 5px;
    --box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background-color: #f7fafc;
    color: var(--text-color);
    line-height: 1.6;
    font-size: 16px;
}

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

.row {
    display: flex;
    flex-wrap: wrap;
    margin: -10px;
}

.col {
    flex: 1;
    min-width: 250px;
    padding: 10px;
}

.col-12 { width: 100%; }
.col-6 { width: 50%; }
.col-4 { width: 33.333%; }
.col-3 { width: 25%; }

/* 响应式 */
@media (max-width: 768px) {
    .col-6 { width: 100%; }
    .col-4 { width: 50%; }
}

@media (max-width: 480px) {
    .col-4 { width: 100%; }
    .col-3 { width: 50%; }
}

/* 排版 */
h1, h2, h3, h4, h5, h6 {
    margin: 20px 0 10px 0;
    font-weight: 600;
}

h1 { font-size: 2.5em; }
h2 { font-size: 2em; }
h3 { font-size: 1.75em; }
h4 { font-size: 1.5em; }
h5 { font-size: 1.25em; }
h6 { font-size: 1em; }

p {
    margin: 10px 0;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--secondary-color);
}

/* 按钮 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1em;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

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

.btn-primary:hover {
    background-color: #5568d3;
    box-shadow: var(--box-shadow);
}

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

.btn-secondary:hover {
    background-color: #663a8b;
    box-shadow: var(--box-shadow);
}

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

.btn-success:hover {
    background-color: #38a169;
}

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

.btn-warning:hover {
    background-color: #dd6b20;
}

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

.btn-danger:hover {
    background-color: #e53e3e;
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-sm {
    padding: 8px 15px;
    font-size: 0.9em;
}

.btn-lg {
    padding: 12px 30px;
    font-size: 1.1em;
}

/* 表单 */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-color);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="date"],
textarea,
select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--gray-medium);
    border-radius: var(--border-radius);
    font-size: 1em;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

/* 卡片 */
.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 20px;
    margin-bottom: 20px;
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.card-header {
    border-bottom: 1px solid var(--gray-medium);
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.card-title {
    margin: 0;
    font-size: 1.25em;
    font-weight: 600;
}

/* 表格 */
.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.table th {
    background-color: var(--gray-light);
    padding: 15px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--gray-medium);
}

.table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--gray-medium);
}

.table tbody tr:hover {
    background-color: #f9fafb;
}

/* 警告和消息 */
.alert {
    padding: 15px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-success {
    background-color: #f0fdf4;
    border-left-color: var(--success-color);
    color: #166534;
}

.alert-warning {
    background-color: #fef3c7;
    border-left-color: var(--warning-color);
    color: #92400e;
}

.alert-danger {
    background-color: #fef2f2;
    border-left-color: var(--danger-color);
    color: #991b1b;
}

.alert-info {
    background-color: #f0f9ff;
    border-left-color: var(--primary-color);
    color: #0c2d6b;
}

/* 导航 */
.navbar {
    background: white;
    padding: 15px 0;
    box-shadow: var(--box-shadow);
    margin-bottom: 30px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--primary-color);
}

.navbar-nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 30px;
}

.navbar-nav a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.navbar-nav a:hover,
.navbar-nav a.active {
    color: var(--primary-color);
}

/* 栅格系统 */
.grid {
    display: grid;
    gap: 20px;
}

.grid-cols-1 { grid-template-columns: 1fr; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
    .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .grid-cols-4 { grid-template-columns: 1fr; }
    .grid-cols-3 { grid-template-columns: 1fr; }
    .grid-cols-2 { grid-template-columns: 1fr; }
}

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

.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }

.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }

.p-10 { padding: 10px; }
.p-20 { padding: 20px; }
.p-30 { padding: 30px; }

.d-none { display: none; }
.d-flex { display: flex; }
.flex-center { justify-content: center; align-items: center; }
.flex-between { justify-content: space-between; align-items: center; }
.flex-gap { gap: 20px; }

.hidden { visibility: hidden; }
.invisible { opacity: 0; }

/* 响应式导航 */
@media (max-width: 768px) {
    .navbar-nav {
        flex-direction: column;
        gap: 10px;
    }
}
