/* ====================================
   现代化UI样式 - 全局统一美化
   ==================================== */

:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --success-color: #4cc9f0;
    --danger-color: #f72585;
    --warning-color: #f8961e;
    --info-color: #4895ef;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --border-radius: 8px;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* 全局基础样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #333;
    background-color: #f5f7fa;
    line-height: 1.6;
    padding-top: 20px;
    transition: var(--transition);
}

/* 容器优化 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Navbar美化 */
.navbar {
    background: linear-gradient(135deg, #4361ee 0%, #3f37c9 100%) !important;
    border-radius: var(--border-radius) !important;
    box-shadow: var(--box-shadow);
    border: none !important;
    margin-bottom: 20px !important;
}

.navbar-brand {
    color: white !important;
    font-weight: 600;
    font-size: 1.2rem;
}

.navbar-nav > li > a {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    transition: var(--transition);
    padding: 15px 12px !important;
}

.navbar-nav > li > a:hover {
    color: white !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
}

.navbar-nav > li.active > a {
    color: white !important;
    background-color: rgba(255, 255, 255, 0.2) !important;
}

/* Panel卡片美化 */
.panel {
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    border: none;
    margin-bottom: 20px;
    overflow: hidden;
    transition: var(--transition);
}

.panel:hover {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.panel-heading {
    background: linear-gradient(135deg, #4361ee 0%, #3f37c9 100%);
    color: white;
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
    border: none;
    padding: 15px 20px;
    font-size: 1.1rem;
    font-weight: 600;
}

.panel-success .panel-heading {
    background: linear-gradient(135deg, #4cc9f0 0%, #4361ee 100%);
}

.panel-body {
    padding: 25px;
    background-color: white;
}

/* 按钮美化 */
.btn {
    border-radius: var(--border-radius);
    border: none;
    padding: 8px 20px;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
}

.btn-default {
    background-color: #f0f2f5;
    color: #555;
    border-color: #ddd;
}

.btn-default:hover {
    background-color: #e4e7eb;
    border-color: #ccc;
}

.btn-success {
    background: linear-gradient(135deg, #4cc9f0 0%, #4361ee 100%);
    color: white;
    border: none;
}

.btn-success:hover {
    background: linear-gradient(135deg, #4895ef 0%, #3f37c9 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #f72585 0%, #b5179e 100%);
    color: white;
    border: none;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c9184a 0%, #9d0240 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(247, 37, 133, 0.3);
}

.btn-primary {
    background: linear-gradient(135deg, #4361ee 0%, #3f37c9 100%);
    color: white;
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #3a56d4 0%, #3530a6 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
}

/* 表单元素美化 */
.form-control {
    border-radius: var(--border-radius);
    border: 1px solid #ddd;
    padding: 10px 15px;
    transition: var(--transition);
    height: auto;
    box-shadow: none;
}

.form-control:focus {
    border-color: #4361ee;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
    outline: none;
}

.input-group-addon {
    background-color: #f8f9fa;
    border-color: #ddd;
    color: #555;
    font-weight: 500;
}

.input-group {
    margin-bottom: 15px;
}

/* 链接样式优化 */
a {
    color: #4361ee;
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: #3f37c9;
    text-decoration: none;
}

/* 工具列表优化 */
.btn-group-justified {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.btn-group-justified .btn {
    flex: 1;
    margin: 5px;
    display: block;
    white-space: normal;
    text-align: center;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .btn-group-justified .btn {
        flex: 1 1 100%;
    }
}

@media (min-width: 768px) and (max-width: 992px) {
    .btn-group-justified .btn {
        flex: 1 1 50%;
    }
}

/* 列表组美化 */
.list-group-item {
    border-radius: var(--border-radius) !important;
    border: 1px solid #e9ecef !important;
    margin-bottom: 8px !important;
    transition: var(--transition);
}

.list-group-item:hover {
    border-color: #4361ee !important;
    background-color: rgba(67, 97, 238, 0.05);
}

.list-group-item-danger {
    background-color: #fff5f5 !important;
    border-color: #f72585 !important;
    color: #c9184a !important;
    font-weight: 600;
}

/* Footer美化 */
.footer {
    margin-top: 40px;
    padding: 30px 0;
    background-color: white;
    border-top: 1px solid #e9ecef;
    border-radius: var(--border-radius);
}

.footer a {
    color: #6c757d;
}

.footer a:hover {
    color: #4361ee;
}

/* 工具页面标题优化 */
header {
    background: linear-gradient(135deg, #4361ee 0%, #3f37c9 100%);
    color: white;
    padding: 20px 0;
    margin-bottom: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

header h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 600;
}

/* 表单行间距优化 */
.form-group {
    margin-bottom: 20px;
}

/* 卡片悬停效果 */
.panel,
.panel-body {
    transition: var(--transition);
}

/* 分割线优化 */
hr {
    border-top: 1px solid #e9ecef;
    margin: 20px 0;
}

/* 响应式表格优化 */
.table {
    margin-bottom: 0;
}

.table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

/* 标签页美化 */
.nav-tabs > li > a {
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    border-color: #ddd;
    color: #666;
}

.nav-tabs > li.active > a {
    background-color: white;
    border-color: #ddd #ddd white;
    color: #4361ee;
}

/* 模态框优化 */
.modal-content {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal-header {
    border-bottom: 1px solid #e9ecef;
    padding: 20px;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
    padding: 20px;
}

/* 加载动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.panel {
    animation: fadeIn 0.5s ease-out;
}

/* 文字样式优化 */
.text-muted {
    color: #868e96 !important;
}

.text-primary {
    color: #4361ee !important;
}

.text-success {
    color: #4cc9f0 !important;
}

.text-danger {
    color: #f72585 !important;
}

/* 工具图标优化 */
.icon {
    font-size: 1.2rem;
    margin-right: 8px;
    vertical-align: middle;
}

/* 面包屑导航优化 */
.breadcrumb {
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
    padding: 10px 15px;
    margin-bottom: 20px;
}

.breadcrumb > li + li:before {
    color: #adb5bd;
}

/* 提示信息美化 */
.alert {
    border-radius: var(--border-radius);
    border: none;
    padding: 15px 20px;
}

.alert-success {
    background-color: #d1f3fa;
    color: #0c5460;
}

.alert-danger {
    background-color: #fad1dc;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

/* 表格行悬停效果 */
.table-hover > tbody > tr:hover {
    background-color: rgba(67, 97, 238, 0.05);
}

/* 下拉菜单美化 */
.dropdown-menu {
    border-radius: var(--border-radius);
    border: 1px solid #e9ecef;
    box-shadow: var(--box-shadow);
    margin-top: 5px;
}

.dropdown-menu > li > a {
    padding: 10px 20px;
    transition: var(--transition);
}

.dropdown-menu > li > a:hover {
    background-color: #f8f9fa;
    color: #4361ee;
}

/* 单选框和复选框美化 */
input[type="radio"],
input[type="checkbox"] {
    margin-right: 8px;
}

/* 图片优化 */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 辅助类 */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

/* 工具卡片网格优化 */
.row {
    margin-bottom: 15px;
}

.col-lg-6, .col-md-6, .col-sm-6, .col-xs-6,
.col-lg-5, .col-md-5, .col-sm-5, .col-xs-5,
.col-lg-4, .col-md-4, .col-sm-4, .col-xs-4,
.col-lg-3, .col-md-3, .col-sm-3, .col-xs-3,
.col-lg-2, .col-md-2, .col-sm-2, .col-xs-2,
.col-lg-1, .col-md-1, .col-sm-1, .col-xs-1 {
    padding-left: 10px;
    padding-right: 10px;
}

/* 滚动条美化 (Webkit浏览器) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 高亮文字 */
mark {
    background-color: #fff9db;
    padding: 2px 4px;
    border-radius: 3px;
}

/* 代码块样式 */
code {
    background-color: #f8f9fa;
    color: #e83e8c;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9rem;
}

/* 预格式化文本 */
pre {
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
    padding: 15px;
    border: 1px solid #e9ecef;
    overflow-x: auto;
}

/* 焦点状态优化 */
*:focus {
    outline: none;
}

/* 链接按钮组优化 */
.btn-group a.btn {
    display: inline-block;
    text-decoration: none;
}

/* 工具页面容器优化 */
.tool-container {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--box-shadow);
}

/* 响应式设计 */
@media (max-width: 767px) {
    .container {
        padding: 0 10px;
    }

    .panel-body {
        padding: 15px;
    }

    .tool-container {
        padding: 20px;
    }

    header h1 {
        font-size: 1.5rem;
    }
}

/* 打印样式优化 */
@media print {
    body {
        background-color: white;
    }

    .navbar,
    .footer {
        display: none;
    }
}
