/* assets/css/style.css - 优化版 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    overflow: hidden; /* 防止内容溢出 */
}

/* 头部导航 */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 15px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

header .container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

header a {
    color: #fff;
    text-decoration: none;
    margin-right: 15px;
    font-weight: 500;
    transition: opacity 0.2s;
}

header a:hover {
    opacity: 0.8;
}

.logo-area {
    display: flex;
    align-items: center;
}

.logo-area img {
    max-height: 40px;
    width: auto;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.user-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.user-info img {
    border: 2px solid #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    border-radius: 50%;
}

/* 主内容区 */
main {
    min-height: 70vh;
    padding: 40px 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-top: 20px;
    overflow: hidden; /* 确保内容不溢出 */
}

/* 卡片样式 */
.card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    padding: 30px;
    margin-bottom: 30px;
}

/* 按钮 */
.btn {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    text-decoration: none;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 10px rgba(102,126,234,0.3);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(102,126,234,0.4);
}

.btn-secondary {
    background: #6c757d;
    box-shadow: 0 4px 10px rgba(108,117,125,0.3);
}

.btn-danger {
    background: #dc3545;
    box-shadow: 0 4px 10px rgba(220,53,69,0.3);
}

/* 表单 */
input, textarea, select {
    width: 100%;
    padding: 12px;
    margin: 8px 0 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

label {
    font-weight: 600;
    display: block;
    margin-bottom: 5px;
    color: #555;
}

/* 表格 */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 20px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    min-width: 600px; /* 保证小屏可滚动 */
}

th {
    background: #f8f9fa;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #dee2e6;
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
}

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

tr:hover {
    background: #f8f9fa;
}

/* 消息提示 */
.alert {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* 分页 */
.pagination {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap;
}

.pagination a, .pagination span {
    display: inline-block;
    padding: 8px 12px;
    background: #f4f4f4;
    color: #333;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.2s;
}

.pagination a.active {
    background: #667eea;
    color: #fff;
}

.pagination a:hover {
    background: #ddd;
}

/* 头像选择网格 */
.avatar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.avatar-item {
    text-align: center;
}

.avatar-item input[type="radio"] {
    display: none;
}

.avatar-item input[type="radio"] + img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border: 3px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s;
}

.avatar-item input[type="radio"]:checked + img {
    border-color: #667eea;
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(102,126,234,0.3);
}

/* 响应式 */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        align-items: flex-start;
    }
    .logo-area, .nav-links, .user-info {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
    .nav-links {
        margin-top: 10px;
    }
    .user-info {
        margin-top: 10px;
    }
    main {
        padding: 20px 10px;
    }
    .container {
        padding: 0 10px;
    }
}

/* 辅助类 */
.text-right { text-align: right; }
.text-center { text-align: center; }
.mb-20 { margin-bottom: 20px; }
.mt-20 { margin-top: 20px; }
/* 强制防止任何元素溢出 */
* {
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
img, video, iframe {
    max-width: 100%;
    height: auto;
}
.container, main, header, footer {
    overflow-x: hidden;
}
table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
}