/* 通用样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #43e97b;
    --error-color: #ff6b6b;
    --text-dark: #2d3748;
    --text-light: #718096;
    --bg-light: #f7fafc;
    --border-color: #e2e8f0;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 15px 50px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-dark);
    line-height: 1.6;
}

/* SVG图标通用样式 */
.icon {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    vertical-align: middle;
}

/* ========== 登录页面样式 ========== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 20px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 420px;
    padding: 40px;
    animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-header h1 {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-light);
    font-size: 14px;
}

.login-form {
    margin-bottom: 30px;
}

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

.form-group label {
    display: flex;
    align-items: center;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
    outline: none;
}

.form-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.error-message {
    color: var(--error-color);
    font-size: 14px;
    padding: 12px;
    border-radius: 8px;
    background: rgba(255, 107, 107, 0.1);
    margin-bottom: 20px;
    display: none;
    animation: shake 0.5s ease;
}

.error-message.show {
    display: block;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

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

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    animation: spin 1s linear infinite;
}

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

.login-footer {
    text-align: center;
    color: var(--text-light);
    font-size: 13px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* ========== 主页样式 ========== */
.home-container {
    min-height: 100vh;
    background: var(--bg-light);
    display: flex;
    flex-direction: column;
}

.home-header {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content h1 {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.user-info {
    display: flex;
    align-items: center;
    color: var(--text-dark);
    font-weight: 500;
    background: var(--bg-light);
    padding: 8px 16px;
    border-radius: 20px;
}

.home-main {
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 30px;
}

.welcome-section {
    text-align: center;
    margin-bottom: 50px;
    animation: fadeInUp 0.6s ease;
}

.welcome-section h2 {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.welcome-section p {
    font-size: 18px;
    color: var(--text-light);
}

.function-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    animation: fadeInUp 0.6s ease 0.2s backwards;
}

.function-card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.function-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.function-card:hover::before {
    transform: scaleX(1);
}

.function-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.card-icon {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.card-icon svg {
    width: 32px;
    height: 32px;
    stroke: white;
}

.function-card h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.function-card p {
    font-size: 14px;
    color: var(--text-light);
}

.logout-card:hover {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.05), rgba(238, 90, 111, 0.05));
}

.home-footer {
    background: white;
    text-align: center;
    padding: 20px;
    color: var(--text-light);
    font-size: 14px;
    border-top: 1px solid var(--border-color);
}

/* ========== 响应式设计 ========== */

/* 平板设备 */
@media (max-width: 1024px) {
    .function-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 20px;
    }
    
    .welcome-section h2 {
        font-size: 28px;
    }
}

/* 手机设备 */
@media (max-width: 768px) {
    .login-box {
        padding: 30px 20px;
    }
    
    .login-header h1 {
        font-size: 26px;
    }
    
    .header-content {
        padding: 15px 20px;
    }
    
    .header-content h1 {
        font-size: 20px;
    }
    
    .home-main {
        padding: 30px 20px;
    }
    
    .welcome-section {
        margin-bottom: 30px;
    }
    
    .welcome-section h2 {
        font-size: 24px;
    }
    
    .welcome-section p {
        font-size: 16px;
    }
    
    .function-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .function-card {
        padding: 24px;
    }
    
    .card-icon {
        width: 56px;
        height: 56px;
    }
    
    .card-icon svg {
        width: 28px;
        height: 28px;
    }
}

/* 小屏手机 */
@media (max-width: 480px) {
    .login-box {
        padding: 24px 16px;
    }
    
    .login-header h1 {
        font-size: 22px;
    }
    
    .form-group input {
        padding: 12px 14px;
        font-size: 14px;
    }
    
    .btn-login {
        padding: 12px;
        font-size: 15px;
    }
    
    .welcome-section h2 {
        font-size: 20px;
    }
    
    .function-card h3 {
        font-size: 18px;
    }
}

/* ========== 功能页面通用样式 ========== */
.page-container {
    min-height: 100vh;
    background: var(--bg-light);
    display: flex;
    flex-direction: column;
}

.page-header {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.btn-back {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-light);
    border: none;
    border-radius: 8px;
    color: var(--text-dark);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-back:hover {
    background: var(--border-color);
}

.btn-back svg {
    width: 20px;
    height: 20px;
}

.page-main {
    flex: 1;
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 30px;
}

.form-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    padding: 40px;
    animation: fadeInUp 0.6s ease;
}

.form-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--bg-light);
}

.form-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.form-icon svg {
    width: 30px;
    height: 30px;
    stroke: white;
}

.form-header h2 {
    font-size: 24px;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.form-header p {
    color: var(--text-light);
    font-size: 14px;
}

.data-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}

.data-form .form-group label {
    display: flex;
    align-items: center;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 8px;
    font-size: 14px;
}

.required {
    color: var(--error-color);
    margin-left: 4px;
}

.data-form .form-group input,
.data-form .form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    outline: none;
    font-family: inherit;
}

.data-form .form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.data-form .form-group input:focus,
.data-form .form-group textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.data-form .form-group small {
    display: block;
    color: var(--text-light);
    font-size: 12px;
    margin-top: 6px;
}

.message {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    display: none;
    animation: slideDown 0.3s ease;
}

.message.show {
    display: block;
}

.message.success {
    background: rgba(67, 233, 123, 0.1);
    color: var(--success-color);
    border-left: 4px solid var(--success-color);
}

.message.error {
    background: rgba(255, 107, 107, 0.1);
    color: var(--error-color);
    border-left: 4px solid var(--error-color);
}

.message.info {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
    border-left: 4px solid var(--primary-color);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 12px;
}

.btn-primary,
.btn-secondary,
.btn-danger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-dark);
}

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

.btn-danger {
    background: linear-gradient(135deg, var(--error-color), #ee5a6f);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.3);
}

.btn-primary:disabled,
.btn-secondary:disabled,
.btn-danger:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* 搜索区域 */
.search-section {
    margin-bottom: 30px;
}

.search-box {
    display: flex;
    gap: 12px;
}

.search-box input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    outline: none;
}

.search-box input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-search:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.edit-section {
    animation: fadeInUp 0.6s ease;
}

/* 响应式调整 */
@media (max-width: 768px) {

/* 信息提示框 */
.info-box {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
    border-left: 4px solid var(--primary-color);
    border-radius: 8px;
    padding: 16px;
    margin: 20px 0;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.info-box .icon {
    width: 24px;
    height: 24px;
    color: var(--primary-color);
    flex-shrink: 0;
    margin-top: 2px;
}

.info-box strong {
    color: var(--text-dark);
    display: block;
    margin-bottom: 8px;
    font-size: 15px;
}

.info-box ul {
    margin: 0;
    padding-left: 20px;
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.8;
}

.info-box li {
    margin-bottom: 4px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .page-main {
        padding: 20px 16px;
    }

    .form-card {
        padding: 24px 20px;
    }

    .form-header {
        gap: 16px;
    }

    .form-icon {
        width: 50px;
        height: 50px;
    }

    .form-icon svg {
        width: 24px;
        height: 24px;
    }

    .form-header h2 {
        font-size: 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .form-actions button {
        width: 100%;
        justify-content: center;
    }

    .search-box {
        flex-direction: column;
    }

    .btn-search {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .form-card {
        padding: 20px 16px;
    }

    .form-header h2 {
        font-size: 18px;
    }

    .btn-back {
        padding: 6px 12px;
        font-size: 14px;
    }
}
