/* 自定义样式 */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-radius: 8px;
    --box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

body {
    background-color: var(--light-color);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

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

.card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #e9ecef;
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
}

/* 标签卡片样式 */
.tag-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    cursor: pointer;
}

.tag-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.tag-color-preview {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-block;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* 表单样式 */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-control-color {
    width: 50px;
    height: 38px;
    border-radius: var(--border-radius);
}

.color-preview {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: var(--secondary-color);
    background-color: #f8f9fa;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

/* 按钮样式 */
.btn {
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-weight: 500;
}

.btn:hover {
    transform: translateY(-1px);
}

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

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

/* 导航栏样式 */
.navbar-brand {
    font-weight: 600;
    font-size: 1.5rem;
}

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

.navbar-nav .nav-link:hover {
    color: rgba(255,255,255,0.8) !important;
}

/* 统计卡片样式 */
.card .fa-2x {
    font-size: 2.5rem !important;
}

/* 标签列表样式 */
#tagsList .col-md-6 {
    margin-bottom: 1rem;
}

.tag-item {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: var(--border-radius);
    padding: 1rem;
    transition: var(--transition);
    height: 100%;
}

.tag-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--box-shadow);
}

.tag-name {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.tag-description {
    color: var(--secondary-color);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.tag-actions {
    display: flex;
    gap: 0.5rem;
}

.tag-actions .btn {
    flex: 1;
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
}

/* 搜索框样式 */
#searchTags {
    transition: var(--transition);
}

#searchTags:focus {
    width: 250px !important;
}

/* 加载动画 */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Toast 通知样式 */
.toast {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.toast-header {
    background-color: #fff;
    border-bottom: 1px solid #e9ecef;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .tag-actions {
        flex-direction: column;
    }
    
    .tag-actions .btn {
        margin-bottom: 0.25rem;
    }
    
    #searchTags:focus {
        width: 200px !important;
    }
    
    .navbar-brand {
        font-size: 1.25rem;
    }
}

@media (max-width: 576px) {
    .col-md-3 {
        margin-bottom: 1rem;
    }
    
    .card .fa-2x {
        font-size: 2rem !important;
    }
    
    .card-title {
        font-size: 0.875rem;
    }
    
    .tag-actions .btn {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --light-color: #1a1a1a;
        --dark-color: #ffffff;
    }
    
    body {
        background-color: var(--light-color);
        color: var(--dark-color);
    }
    
    .card {
        background-color: #2d2d2d;
        color: var(--dark-color);
    }
    
    .card-header {
        background-color: #2d2d2d;
        border-bottom-color: #404040;
    }
    
    .tag-item {
        background-color: #2d2d2d;
        border-color: #404040;
        color: var(--dark-color);
    }
    
    .form-control {
        background-color: #2d2d2d;
        border-color: #404040;
        color: var(--dark-color);
    }
    
    .form-control:focus {
        background-color: #2d2d2d;
        border-color: var(--primary-color);
        color: var(--dark-color);
    }
    
    .text-muted {
        color: #adb5bd !important;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

.slide-in {
    animation: slideIn 0.3s ease-out;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

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

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

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

/* 工具提示样式 */
.tooltip {
    font-size: 0.875rem;
}

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

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

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

/* Footer 样式 */
.footer {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border-top: 3px solid var(--primary-color);
}

.footer h5 {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer h6 {
    color: #ecf0f1;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.footer p {
    line-height: 1.6;
    margin-bottom: 1rem;
}

.footer .text-muted {
    color: #bdc3c7 !important;
}

.footer .social-links a {
    transition: var(--transition);
    display: inline-block;
}

.footer .social-links a:hover {
    color: var(--primary-color) !important;
    transform: translateY(-2px);
}

.footer .list-unstyled li a {
    transition: var(--transition);
    display: block;
    padding: 0.25rem 0;
}

.footer .list-unstyled li a:hover {
    color: var(--primary-color) !important;
    padding-left: 0.5rem;
}

.footer .footer-links a {
    transition: var(--transition);
}

.footer .footer-links a:hover {
    color: var(--primary-color) !important;
}

.footer hr {
    border-color: #4a5568;
    opacity: 0.3;
}

/* Footer 响应式设计 */
@media (max-width: 768px) {
    .footer .col-md-6.text-md-end {
        text-align: center !important;
        margin-top: 1rem;
    }
    
    .footer .footer-links {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .footer .social-links {
        text-align: center;
        margin-top: 1rem;
    }
}

@media (max-width: 576px) {
    .footer .col-lg-4,
    .footer .col-lg-2,
    .footer .col-lg-3 {
        margin-bottom: 2rem;
    }
    
    .footer .social-links a {
        margin: 0 0.75rem;
    }
}

/* 页面布局调整 */
.min-vh-100 {
    min-height: 100vh;
}

.flex-grow-1 {
    flex-grow: 1;
}

/* 响应式 Photo Gallery 容器：PC 上不超过 900px，移动端占满宽度 */
.photo-gallery-wrapper {
  width: 100%;
  max-width: 900px;
}

/* 移动端优化：缩小标题与内边距，避免遮挡 */
@media (max-width: 576px) {
  .carousel-caption .bg-dark {
    padding: 0.5rem 0.75rem;
  }
  .carousel-caption h5 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
  }
  .carousel-caption p {
    font-size: 0.875rem;
    margin-bottom: 0;
  }
}
/* Items 页控件响应式宽度：桌面固定，移动端占满 */
.item-search-input { width: 260px; }
.item-filter-select { width: 180px; }
@media (max-width: 576px) {
  .item-search-input, .item-filter-select { width: 100%; }
}
/* Visualize 页选择器响应式宽度：桌面固定宽度，移动端占满 */
.visual-select {
  width: 220px;
}
@media (max-width: 576px) {
  .visual-select {
    width: 100%;
  }
}
/* History 页控件响应式宽度：桌面固定，移动端占满 */
.history-date { width: 160px; }
.history-operator { width: 200px; }
@media (max-width: 576px) {
  .history-date,
  .history-operator,
  .history-filter-btn { width: 100%; }
}
/* Footer 折叠按钮样式与交互 */
.footer .btn-link { color: #f8f9fa; }
.footer .btn-link:hover { text-decoration: none; }
.footer .btn-link i { transition: transform 0.2s ease; }
.footer .btn-link[aria-expanded="true"] i { transform: rotate(180deg); }