/* 全局样式 */
:root {
    --primary-color: #0d6efd;
    --primary-light: #d0d9ff;
    --success-color: #198754;
    --success-light: #afbfff;
    --warning-color: #ffc107;
    --warning-light: #91a7ff;
    --info-color: #0dcaf0;
    --info-light: #738ffe;
    --light-bg: #f8f9fa;
    --border-color: #dee2e6;
    --shadow-sm: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
    --shadow-md: 0 0.5rem 1rem rgba(0,0,0,0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Bootstrap Icons 样式确保 */
.bi {
    display: inline-block;
    vertical-align: middle;
    font-size: 1rem;
}

/* 确保图标可见 */
i[class^="bi-"],
i[class*=" bi-"] {
    display: inline-block;
    width: 1em;
    height: 1em;
    line-height: 1;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: var(--light-bg);
}

/* 渐变背景 */
.bg-gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.bg-gradient-success {
    background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
}

.bg-gradient-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.bg-gradient-info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* 导航栏样式 */
.navbar {
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1030;
}

/* 下拉菜单样式 */
.dropdown-menu {
    z-index: 1040 !important;
    border-radius: 8px;
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    margin-top: 0.5rem;
    position: absolute !important;
}

.navbar-collapse {
    background-color: white;
    z-index: 1035;
}

.navbar-brand {
    font-weight: 700;
    transition: var(--transition);
}

.navbar-brand:hover {
    transform: translateY(-2px);
}

.nav-link {
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 80%;
}

/* 英雄区域 */
.hero-section {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff" fill-opacity="0.1" d="M0,96L48,112C96,128,192,160,288,165.3C384,171,480,149,576,138.7C672,128,768,128,864,149.3C960,171,1056,213,1152,213.3C1248,213,1344,171,1392,149.3L1440,128L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>');
    background-size: cover;
    background-position: bottom;
    opacity: 0.3;
}

/* 工具卡片样式 */
.tool-card {
    border-radius: 16px;
    overflow: hidden;
    transition: var(--transition);
    position: relative;
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
}

.tool-card .card-title {
    color: #212529;
    font-weight: 600;
    font-size: 1.25rem;
}

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

.tool-card-hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 1rem 2rem rgba(0,0,0,0.2);
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--info-color));
    transform: scaleX(0);
    transition: var(--transition);
}

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

/* 工具图标 */
.tool-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: var(--transition);
}

.tool-card:hover .icon-circle {
    transform: scale(1.1) rotate(5deg);
}

.icon-circle i {
    transition: var(--transition);
}

.tool-card:hover .icon-circle i {
    transform: scale(1.2);
}

/* 颜色变体 */
.bg-primary-light {
    background: var(--primary-light);
}

.bg-success-light {
    background: var(--success-light);
}

.bg-warning-light {
    background: var(--warning-light);
}

.bg-info-light {
    background: var(--info-light);
}

/* 工具链接 */
.tool-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.tool-link:hover {
    border-left-color: var(--primary-color);
    transform: translateX(5px);
}

.tool-link i {
    transition: var(--transition);
}

.tool-link:hover i {
    transform: translateX(3px);
}

/* 工具链接包装器 */
.tool-link-wrapper {
    gap: 0.5rem;
    align-items: center;
}

/* 使用说明按钮样式 */
.guide-btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    white-space: nowrap;
    transition: var(--transition);
}

.guide-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.3);
}

/* 公告区样式 */
.announcement-section {
    position: relative;
}

.announcement-section .card {
    border-radius: 16px;
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    transition: var(--transition);
}

.announcement-section .card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

/* 特色功能 */
.feature-item {
    padding: 2rem 1rem;
    transition: var(--transition);
}

.feature-item:hover {
    transform: translateY(-5px);
}

.feature-item i {
    transition: var(--transition);
}

.feature-item:hover i {
    transform: scale(1.1);
    filter: brightness(1.2);
}

/* 表单样式 */
.form-control, .form-select {
    border-radius: 8px;
    border: 2px solid var(--border-color);
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

/* 登录和注册页面样式 */
.auth-page h3 {
    margin-top: 2rem;
    margin-bottom: 1.5rem;
}

/* 固定页脚 */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
}

footer {
    margin-top: auto;
}

/* 按钮样式 */
.btn {
    border-radius: 8px;
    font-weight: 600;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #4dabf7);
    border: none;
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #51cf66);
    border: none;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color), #ffd43b);
    border: none;
}

.btn-info {
    background: linear-gradient(135deg, var(--info-color), #66d9e8);
    border: none;
}

/* 加载动画 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: var(--shadow-md);
    animation: slideUp 0.3s ease-out;
}

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

/* 警告框样式 */
.alert {
    border: none;
    border-radius: 12px;
    animation: slideInRight 0.3s ease-out;
}

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

/* 表格样式 */
.table {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table thead {
    background: linear-gradient(135deg, var(--primary-color), #4dabf7);
    color: white;
}

.table thead th {
    border: none;
    font-weight: 600;
    padding: 1rem;
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background-color: var(--primary-light);
    transform: scale(1.01);
}

/* 卡片样式增强 */
.card {
    border-radius: 16px;
    border: none;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-bottom: none;
    border-radius: 16px 16px 0 0 !important;
    font-weight: 600;
}

/* 页面切换动画 */
.page-transition {
    animation: fadeInUp 0.5s ease-out;
}

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

/* 工具页面布局 */
.tool-page {
    min-height: 100vh;
    padding-top: 2rem;
}

.tool-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 3rem 0;
    margin-bottom: 3rem;
    border-radius: 0 0 50px 50px;
    color: white;
}

.tool-header h1,
.tool-header p,
.tool-header i {
    color: white !important;
}

.tool-content {
    max-width: 1200px;
    margin: 0 auto;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .hero-section {
        padding: 3rem 0;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .tool-card {
        margin-bottom: 1.5rem;
    }
    
    .tool-icon {
        margin-bottom: 1rem;
        text-align: center;
    }
    
    .icon-circle {
        width: 56px;
        height: 56px;
        font-size: 1.25rem;
    }
    
    .navbar-nav {
        text-align: center;
    }
    
    .dropdown-menu {
        text-align: center;
    }
    
    .feature-item {
        margin-bottom: 2rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #e9ecef;
    }
    
    .card {
        background-color: #2d3748;
        color: #e9ecef;
    }
    
    .table {
        color: #e9ecef;
    }
    
    .table tbody tr:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }
}

/* 滚动条样式 */
/* 暂时注释掉滚动条样式，以测试是否是滚动条导致的问题 */
/*
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0b5ed7;
}
*/

/* 焦点样式 */
.focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* 打印样式 */
@media print {
    .navbar,
    .btn,
    .loading-overlay {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.4;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* 隐藏数字输入框的上下调整箭头 */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Firefox浏览器 */
input[type=number] {
    -moz-appearance: textfield;
}

/* IE/Edge浏览器 */
input[type=number]::-ms-clear {
    display: none;
}

input[type=number]::-ms-reveal {
    display: none;
}