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

html, body {
    height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #f1f5f9;
    overflow: hidden;
}

/* 主容器 */
.main-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
}

/* 头部样式 */
header {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 100;
    height: 56px;
    flex-shrink: 0;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: 100%;
}

/* 导航菜单 */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 10px;
}

.nav-menu li a {
    display: block;
    padding: 8px 16px;
    text-decoration: none;
    color: #cbd5e1;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    font-size: 1.05rem;
    position: relative;
    overflow: hidden;
    background: rgba(30, 41, 59, 0.7);
    text-shadow: 0 0 8px rgba(203, 213, 225, 0.3);
    animation: menuGlow 4s ease-in-out infinite alternate;
    white-space: nowrap;
}

.nav-menu li a:hover {
    background: rgba(56, 70, 97, 0.8);
    color: #e2e8f0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    text-shadow: 0 0 12px rgba(226, 232, 240, 0.5);
}

.nav-menu li a.active {
    background: rgba(56, 70, 97, 0.9);
    -webkit-text-fill-color: white;
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.7);
    animation: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

@keyframes titleGlow {
    0% {
        text-shadow: 0 0 5px rgba(56, 189, 248, 0.3);
    }
    100% {
        text-shadow: 0 0 20px rgba(56, 189, 248, 0.8), 0 0 30px rgba(34, 211, 238, 0.6);
    }
}

.header-container h1 {
    font-size: 1.5rem;
    background: linear-gradient(to right, #60a5fa, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titleGlow 3s ease-in-out infinite alternate;
    position: relative;
    white-space: nowrap;
}


/* 用户信息区域 */
.user-info {
    position: relative;
    display: flex;
    align-items: center;
}

/* 用户下拉菜单 */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
    white-space: nowrap;
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dropdown-toggle:hover {
    background: rgba(56, 70, 97, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.dropdown-toggle svg {
    fill: currentColor;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(30, 41, 59, 0.95);
    color: #e2e8f0;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    overflow: hidden;
    display: none;
    min-width: 160px;
    z-index: 100;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform-origin: top right;
    animation: dropdownFade 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 0.5rem;
}

@keyframes dropdownFade {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 移除悬停展开，改为点击展开 */
/* .dropdown:hover .dropdown-menu {
    display: block;
} */

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1.2rem;
    color: #e2e8f0;
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dropdown-menu a:last-child {
    border-bottom: none;
}

.dropdown-menu a:hover {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    color: white;
    padding-left: 1.5rem;
}

.dropdown-menu a svg {
    fill: currentColor;
}

/* 主容器样式 - 居中并占满高度，无水平边距 */
.main-container {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    padding: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* 主内容区域 - 占据剩余空间，并提供内边距 */
main {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow-y: hidden;
}

/* 模块容器样式 */
.module-container {
    background: rgba(30, 41, 59, 0.5);
    border-radius: 12px;
    padding: 1rem;
    height: 100%;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.module-container h2 {
    margin-bottom: 20px;
    color: #f1f5f9;
    font-size: 1.6rem;
    text-shadow: 0 0 10px rgba(148, 163, 184, 0.5);
    animation: titleGlow 3s ease-in-out infinite alternate;
    white-space: nowrap;
}

/* 页脚样式 */
footer {
    background: linear-gradient(135deg, #1e293b, #334155);
    padding: 0 20px;
    text-align: center;
    color: #cbd5e1;
    font-size: 0.9rem;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-text {
    margin: 0;
    line-height: 1;
}

@keyframes menuGlow {
    0% {
        text-shadow: 0 0 2px rgba(203, 213, 225, 0.3);
    }
    100% {
        text-shadow: 0 0 8px rgba(203, 213, 225, 0.6), 0 0 12px rgba(203, 213, 225, 0.4);
    }
}

nav a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.2), rgba(96, 165, 250, 0.2));
    z-index: -1;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

nav a:hover::before {
    transform: translateY(0);
}

nav a:hover,
nav a.active {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

nav a.active::before {
    transform: translateY(0);
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.3), rgba(96, 165, 250, 0.3));
}

nav a.active {
    background: rgba(59, 130, 246, 0.15);
    -webkit-background-clip: text;
    -webkit-text-fill-color: white;
    background-clip: text;
    animation: none; /* 选中状态下禁用动画 */
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:hover::before {
    transform: translateX(0);
}

.btn-primary {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    color: white;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background: linear-gradient(90deg, #64748b, #94a3b8);
    color: white;
    box-shadow: 0 4px 6px rgba(100, 116, 139, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(100, 116, 139, 0.4);
}

.btn-danger {
    background: linear-gradient(90deg, #ef4444, #f87171);
    color: white;
    box-shadow: 0 4px 6px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(239, 68, 68, 0.4);
}

/* 表单样式 */
.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: #334155;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background-color: #fff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* 表格样式 */
.table-container {
    overflow-x: auto;
    margin-bottom: 1.2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
}

table th,
table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

table th {
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    font-weight: 600;
    color: #334155;
}

table tr:hover {
    background-color: #f8fafc;
}

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

/* 卡片样式 */
.card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #e2e8f0;
}

.card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
}

.card h3 {
    margin-top: 0;
    color: #0f172a;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.8rem;
    margin-bottom: 1.2rem;
    font-size: 1.3rem;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-content {
    background-color: white;
    margin: 8% auto;
    padding: 0;
    border-radius: 10px;
    width: 90%;
    max-width: 550px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 85vh;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-header {
    padding: 1.2rem 1.5rem;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: white;
    border-radius: 10px 10px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.4rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.2rem 1.5rem;
    background-color: #f8fafc;
    border-radius: 0 0 10px 10px;
    text-align: right;
    border-top: 1px solid #e2e8f0;
}

.close {
    color: white;
    float: right;
    font-size: 1.8rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
}

.close:hover {
    transform: rotate(90deg);
}

/* 确认对话框样式 */
.confirm-dialog {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.confirm-content {
    background-color: white;
    margin: 15% auto;
    padding: 0;
    border-radius: 10px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.confirm-body {
    padding: 1.5rem;
    font-size: 1rem;
    line-height: 1.6;
    color: #334155;
    text-align: left;
}

.confirm-body p {
    margin-bottom: 1rem;
    white-space: pre-line; /* 保留换行符 */
}

.confirm-body p:last-child {
    margin-bottom: 0;
}

.confirm-header {
    padding: 1.2rem 1.5rem;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: white;
    border-radius: 10px 10px 0 0;
}

.confirm-header h2 {
    margin: 0;
    font-size: 1.3rem;
}

.confirm-body {
    padding: 1.5rem;
    font-size: 1rem;
}

.confirm-footer {
    padding: 1.2rem 1.5rem;
    background-color: #f8fafc;
    border-radius: 0 0 10px 10px;
    text-align: right;
    border-top: 1px solid #e2e8f0;
}

/* 消息提示样式 */
.message {
    padding: 1rem 1.2rem;
    margin: 1rem 0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border-left: 4px solid transparent;
}

.message.success {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #166534;
    border-left-color: #22c55e;
}

.message.error {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #991b1b;
    border-left-color: #ef4444;
}

.message.warning {
    background: linear-gradient(135deg, #fef9c3, #fef08a);
    color: #854d0e;
    border-left-color: #eab308;
}

/* 安装向导样式 */
.install-wizard {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    padding: 2rem;
    margin: 2rem auto;
    max-width: 800px;
    border: 1px solid #e2e8f0;
}

.install-header {
    text-align: center;
    margin-bottom: 2rem;
    color: #0f172a;
}

.install-header h1 {
    margin-bottom: 0.5rem;
    font-size: 2rem;
}

.install-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    position: relative;
}

.install-steps::before {
    content: '';
    position: absolute;
    top: 22px;
    left: 0;
    right: 0;
    height: 3px;
    background-color: #e2e8f0;
    z-index: 1;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
}

.step-number {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 0.8rem;
    color: #64748b;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.step.active .step-number {
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    color: white;
    box-shadow: 0 6px 12px rgba(59, 130, 246, 0.3);
    transform: translateY(-3px);
}

.step-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #64748b;
    text-align: center;
}

.step.active .step-label {
    color: #3b82f6;
    font-weight: 600;
}

.install-content .message {
    margin: 1rem 0;
    padding: 1rem 1.2rem;
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #166534;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    font-size: 0.95rem;
    border-left: 4px solid #22c55e;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-container {
        padding: 0 10px;
    }
    
    header {
        padding: 0 15px;
        /* 在小屏幕上允许换行，让用户信息和标题更好地布局 */
        flex-wrap: wrap;
        /* 增加一点上下内边距，改善视觉呼吸感 */
        padding-top: 8px;
        padding-bottom: 8px;
    }
    
    /* 当屏幕很小时，导航菜单变为可横向滚动 */
    .nav-menu {
        width: 100%;
        overflow-x: auto;
        padding: 10px 0;
        margin-top: 10px;
        gap: 5px;
        /* 移除可能引起布局问题的flex-wrap */
        flex-wrap: nowrap;
    }
    
    .nav-menu li a {
        padding: 6px 12px;
        font-size: 0.95rem;
        white-space: nowrap;
    }
    
    main {
        padding: 10px 0;
    }
    
    .module-container {
        padding: 15px;
        height: 100%;
    }
    
    .module-container h2 {
        font-size: 1.4rem;
    }
    
    footer {
        padding: 0 10px;
        font-size: 0.8rem;
        height: 20px;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
    
    .install-wizard {
        padding: 1.2rem;
        margin: 1.2rem;
    }
    
    .install-header h1 {
        font-size: 1.5rem;
    }
}