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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* 消息提示样式 */
.messages-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
}

.message {
    padding: 15px 20px;
    margin-bottom: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.message.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

.close-btn {
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
    margin-left: 15px;
    opacity: 0.7;
}

.close-btn:hover {
    opacity: 1;
}

/* 认证页面样式 */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 420px;
}

.auth-box h1 {
    text-align: center;
    color: #667eea;
    margin-bottom: 30px;
    font-size: 28px;
}

.auth-form {
    display: flex;
    flex-direction: column;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s;
}

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

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
    margin-top: 10px;
}

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

.auth-links {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

.auth-links a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.auth-links a:hover {
    text-decoration: underline;
}

/* 主布局样式 */
.main-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 顶部导航 */
.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 0 24px;
    min-height: 56px;
    background: linear-gradient(90deg, #2c3e50 0%, #34495e 100%);
    color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-nav-brand {
    flex-shrink: 0;
}

.top-nav-brand .brand-link {
    font-size: 20px;
    font-weight: 700;
    color: white;
    text-decoration: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.top-nav-brand .brand-link:hover {
    opacity: 0.9;
}

.top-nav-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.top-nav-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 14px;
    border-radius: 8px;
    transition: all 0.2s;
}

.top-nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.top-nav-item.active {
    background: rgba(102, 126, 234, 0.35);
    color: white;
}

.top-nav-item .icon {
    font-size: 16px;
}

/* 统计下拉菜单 */
.top-nav-dropdown {
    position: relative;
}

.top-nav-dropdown-trigger {
    cursor: pointer;
}

.top-nav-dropdown-trigger .dropdown-arrow {
    font-size: 10px;
    margin-left: 2px;
    opacity: 0.8;
}

.top-nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    min-width: 168px;
    margin-top: 0;
    padding: 6px 0;
    background: #2c3e50;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    display: none;
    z-index: 200;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* 填补触发器与下拉菜单之间的 hover 空隙，避免鼠标划过时菜单闪退 */
.top-nav-dropdown-menu::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -8px;
    height: 10px;
    background: transparent;
}

.top-nav-dropdown:hover .top-nav-dropdown-menu {
    display: block;
}

.top-nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.top-nav-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.top-nav-dropdown-item.active {
    background: rgba(102, 126, 234, 0.35);
    color: white;
}

.top-nav-dropdown-item .icon {
    font-size: 16px;
}

.top-nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-nav-user .user-name {
    font-weight: 500;
    color: white;
}

.logout-btn {
    color: #ff6b6b;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: rgba(255, 107, 107, 0.1);
}

/* 主内容区域样式 */
.main-content {
    flex: 1;
    width: 100%;
    background: #f5f7fa;
    overflow-y: auto;
}

.content-header {
    background: white;
    padding: 6px 12px;
    /* padding: 0; */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.content-header h1 {
    color: #2c3e50;
    font-size: 16px;
    line-height: 1.2;
    margin: 0;
}

/* page_title 全局强制紧凑：单行、低高度（覆盖各页面局部样式） */
.content-header .content-header-inner {
    min-height: 30px;
    display: flex;
    align-items: center;
}

.content-header .page-title-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px !important;
    flex-wrap: nowrap !important;
    margin: 0 !important;
    width: 100%;
    min-height: 30px;
}

.content-header .page-title-wrapper > div {
    min-width: 0;
    flex: 1 1 auto;
}

.content-header .page-title-wrapper h1 {
    margin: 0;
    font-size: 16px !important;
    line-height: 1.2 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.content-header .page-title-wrapper .subtitle,
.content-header .page-title-wrapper p {
    display: none !important;
}

.content-header .page-title-wrapper > a,
.content-header .page-title-wrapper .page-title-actions {
    flex: 0 0 auto;
    white-space: nowrap;
}

.content-header .page-title-wrapper .back-link,
.content-header .page-title-wrapper .btn-back,
.content-header .page-title-wrapper .btn-add-new {
    margin: 0 !important;
    font-size: 12px !important;
    padding: 6px 10px !important;
    line-height: 1.1 !important;
}

.content-body {
    padding: 10px 40px 30px;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
    overflow: hidden;
    transition: all 0.3s;
}

.card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.card-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e9ecef;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.card-header h3 {
    color: white;
    font-size: 18px;
}

.card-body {
    padding: 25px;
}

/* 仪表盘网格 */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.card.full-width {
    grid-column: 1 / -1;
}

/* 统计数字样式 */
.stat-number {
    font-size: 48px;
    font-weight: bold;
    color: #667eea;
    margin: 20px 0 10px;
    text-align: center;
}

.stat-label {
    color: #666;
    text-align: center;
    font-size: 16px;
}

/* 快速链接 */
.quick-links {
    list-style: none;
}

.quick-links li {
    margin: 12px 0;
}

.quick-links a {
    color: #667eea;
    text-decoration: none;
    font-size: 16px;
    transition: all 0.3s;
}

.quick-links a:hover {
    color: #764ba2;
    padding-left: 5px;
}

/* 个人资料样式 */
.profile-container, .settings-container {
    max-width: 800px;
}

.profile-info {
    padding: 10px 0;
}

.info-row {
    display: flex;
    padding: 15px 0;
    border-bottom: 1px solid #e9ecef;
}

.info-row:last-child {
    border-bottom: none;
}

.info-row label {
    font-weight: 600;
    width: 120px;
    color: #555;
}

.info-row span {
    color: #333;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .top-nav {
        padding: 0 16px;
        min-height: 52px;
    }

    .top-nav-menu {
        gap: 2px;
    }

    .top-nav-item {
        padding: 8px 10px;
        font-size: 13px;
    }

    .content-header {
        padding: 4px 8px;
    }

    .content-header h1 {
        font-size: 14px;
    }

    .content-header .page-title-wrapper {
        gap: 6px !important;
        min-height: 26px;
    }

    .content-header .page-title-wrapper h1 {
        font-size: 14px !important;
    }

    .content-body {
        padding: 20px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

