/* 公共样式 - 微工具平台 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    transition: background-color 0.3s, color 0.3s;
}

.wrapper {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: 240px;
    background-color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    padding: 0 0 24px;
    border-right: 1px solid #e8e8e8;
    transition: background-color 0.3s, border-color 0.3s;
}

.sidebar-header {
    height: 65px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-header a {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    outline: none;
}

.sidebar-header .sidebar-logo {
    height: 65px;
    width: auto;
    object-fit: contain;
}

.sidebar-desc {
    font-size: 12px;
    color: #888;
    margin-top: 6px;
    margin-left: 44px;
}

.nav-list {
    list-style: none;
}

.nav-item {
    padding: 12px 20px 12px 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #555;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.nav-item:hover {
    background-color: #f1f5f9;
    color: #6366f1;
}

.nav-item.active {
    background-color: #eef2ff;
    color: #6366f1;
    font-weight: 600;
}

.nav-item-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-radius: 10px;
    flex-shrink: 0;
}

.nav-item.active .nav-item-icon {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* 主内容区 */
.main-content {
    flex: 1;
    margin-left: 240px;
    padding: 0;
}

/* 顶部栏（topbar）：搜索框 + 主题切换按钮 */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    background: #ffffff;
    height: 65px;
    box-sizing: border-box;
}

.search-box {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border-radius: 24px;
    padding: 10px 16px;
    flex: 1;
    max-width: 600px;
    transition: all 0.3s;
    position: relative;
}

/* 搜索下拉建议 */
.search-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    max-height: 340px;
    overflow-y: auto;
    z-index: 1000;
    padding: 6px;
    box-sizing: border-box;
}
.search-dropdown.active {
    display: block;
}
.search-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 8px;
    cursor: pointer;
}
.search-item:hover,
.search-item.active {
    background: #f5f3ff;
}
.search-item-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #fff;
    flex-shrink: 0;
}
.search-item-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.search-item-name {
    font-size: 14px;
    color: #374151;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.search-item-desc {
    font-size: 12px;
    color: #9ca3af;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.search-empty {
    padding: 14px 12px;
    font-size: 13px;
    color: #9ca3af;
    text-align: center;
}

.search-box:focus-within {
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.search-icon {
    width: 18px;
    height: 18px;
    color: #8b5cf6;
    margin-right: 12px;
    flex-shrink: 0;
}

.search-input {
    border: none;
    background: transparent;
    flex: 1;
    font-size: 14px;
    outline: none;
    color: #374151;
}

.search-input::placeholder {
    color: #9ca3af;
}

.theme-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f8f9fa;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
}

.theme-btn:hover {
    background: #e5e7eb;
}

.theme-icon {
    width: 18px;
    height: 18px;
    color: #6b7280;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .top-bar {
        padding: 10px 16px;
    }
}

/* 工具卡片 - 首页网格布局 */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.tool-card {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: row;
    gap: 16px;
    align-items: center;
}

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

.tool-card-header {
    display: flex;
    gap: 16px;
    align-items: center;
}

.tool-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 600;
    flex-shrink: 0;
    color: white;
}

.tool-icon.blue { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.tool-icon.red { background: linear-gradient(135deg, #ef4444, #dc2626); }
.tool-icon.green { background: linear-gradient(135deg, #10b981, #059669); }
.tool-icon.orange { background: linear-gradient(135deg, #f97316, #ea580c); }
.tool-icon.purple { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.tool-icon.pink { background: linear-gradient(135deg, #ec4899, #db2777); }
.tool-icon.cyan { background: linear-gradient(135deg, #06b6d4, #0891b2); }

.tool-info {
    flex: 1;
}

.tool-name {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.tool-desc {
    font-size: 12px;
    color: #888;
    line-height: 1.4;
}

.tool-tag {
    position: absolute;
    top: 16px;
    right: 16px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 600;
}

.tool-tag.new {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.tool-tag.hot {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

/* 空状态 */
.empty-state {
    background-color: #fff;
    padding: 60px;
    border-radius: 8px;
    text-align: center;
}

.empty-state .icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #333;
}

.empty-state p {
    color: #888;
    font-size: 14px;
}

/* 分类头部 */
.category-header {
    background-color: #fff;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.category-header h1 {
    font-size: 20px;
    color: #333;
    margin-bottom: 6px;
}

.category-header p {
    font-size: 14px;
    color: #888;
}

/* 工具介绍 */
.tool-intro {
    background-color: #f8f9fa;
    padding: 24px;
    border-radius: 12px;
}

.tool-intro h3 {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin-bottom: 12px;
}

.tool-intro p {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 20px 30px;
    color: #999;
    font-size: 12px;
    margin-top: 8px;
}

/* 工具详情页：内容列贴左，页脚与内容列（max-width 1200px）同轴对齐，避免相对内容偏右 */
.content-box + .footer {
    max-width: 1200px;
    margin-left: 0;
    margin-right: auto;
}

/* 首页/常用/分类页：内容列贴左（max-width 1400px），页脚与内容列同轴对齐，避免相对内容偏右 */
.home-container ~ .footer,
.common-container ~ .footer,
.category-container ~ .footer {
    max-width: 1400px;
    margin-left: 0;
    margin-right: auto;
}

/* 深色主题 */
body.dark {
    background-color: #1a1a2e;
    color: #e0e0e0;
}

body.dark .sidebar {
    background-color: #16213e;
    border-color: #333;
}

body.dark .sidebar-title {
    color: #a78bfa;
}

body.dark .sidebar-desc {
    color: #666;
}

body.dark .nav-item {
    color: #aaa;
}

body.dark .nav-item:hover,
body.dark .nav-item.active {
    background-color: #0f3460;
    color: #a78bfa;
}

body.dark .top-bar {
    background: #1f2937;
    border-bottom-color: #374151;
}

body.dark .search-box {
    background: #374151;
}

body.dark .search-box:focus-within {
    background: #4b5563;
}

body.dark .search-input {
    color: #e5e7eb;
}

body.dark .search-input::placeholder {
    color: #6b7280;
}

body.dark .theme-btn {
    background: #374151;
}

body.dark .theme-btn:hover {
    background: #4b5563;
}

body.dark .theme-icon {
    color: #9ca3af;
}

body.dark .search-dropdown {
    background: #1f2937;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}
body.dark .search-item:hover,
body.dark .search-item.active {
    background: #374151;
}
body.dark .search-item-name {
    color: #e5e7eb;
}
body.dark .search-item-desc {
    color: #6b7280;
}

body.dark .section-title {
    color: #e0e0e0;
}

body.dark .tool-card {
    background-color: #2d3436;
    border-color: #444;
}

body.dark .tool-name {
    color: #e0e0e0;
}

body.dark .tool-desc {
    color: #888;
}

body.dark .empty-state {
    background-color: #2d3436;
}

body.dark .empty-state h3 {
    color: #e0e0e0;
}

body.dark .category-header {
    background-color: #2d3436;
}

body.dark .category-header h1 {
    color: #e0e0e0;
}

body.dark .category-header p {
    color: #888;
}

body.dark .tool-intro {
    background-color: #2d3436;
}

body.dark .tool-intro h3 {
    color: #e0e0e0;
}

body.dark .tool-intro p {
    color: #888;
}

body.dark .footer {
    color: #666;
}

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

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.form-row {
    display: flex;
    gap: 16px;
    align-items: center;
}

.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    background-color: #fff;
    transition: all 0.2s;
    font-family: inherit;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-select {
    width: auto;
    min-width: 120px;
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

/* 错误提示框 */
.error-box {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 16px;
    color: #dc2626;
    font-size: 14px;
}

body.dark .error-box {
    background-color: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    color: #f87171;
}

/* ============ 表单验证状态 ============ */
.form-input.error,
.form-textarea.error,
.form-select.error,
.setting-input.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.form-input.success,
.form-textarea.success,
.form-select.success,
.setting-input.success {
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.form-input.warning,
.form-textarea.warning,
.form-select.warning,
.setting-input.warning {
    border-color: #eab308;
    box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.2);
}

/* ============ 表单帮助文字 ============ */
.form-hint {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
    display: block;
}

.form-hint.error {
    color: #ef4444;
}

.form-hint.success {
    color: #22c55e;
}

body.dark .form-hint {
    color: #9ca3af;
}

/* ============ 输入组（带前缀/后缀） ============ */
.input-group {
    display: flex;
    align-items: center;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s;
}

.input-group:focus-within {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.input-group-prefix {
    padding: 10px 14px;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 14px;
    border-right: 2px solid #e5e7eb;
    flex-shrink: 0;
}

.input-group-suffix {
    padding: 10px 14px;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 14px;
    border-left: 2px solid #e5e7eb;
    flex-shrink: 0;
}

.input-group .form-input,
.input-group .setting-input {
    border: none;
    box-shadow: none;
    padding: 10px 14px;
    margin: 0;
}

body.dark .input-group {
    border-color: #495057;
}

body.dark .input-group-prefix,
body.dark .input-group-suffix {
    background: #212529;
    border-color: #495057;
    color: #9ca3af;
}

/* ============ 单选按钮 ============ */
input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #8b5cf6;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

input[type="radio"]:hover {
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

input[type="radio"]:checked {
    background: #8b5cf6;
    border-color: #8b5cf6;
}

input[type="radio"]:checked::after {
    content: '';
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

input[type="radio"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.3);
}

/* ============ 开关按钮 ============ */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e5e7eb;
    transition: 0.3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.3);
}

body.dark .toggle-slider {
    background-color: #495057;
}

/* ============ 文件上传控件 ============ */
.file-upload {
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.file-upload input[type="file"] {
    position: absolute;
    opacity: 0;
    right: 0;
    top: 0;
    height: 100%;
    width: 100%;
    cursor: pointer;
}

.file-upload-btn {
    display: inline-block;
    padding: 10px 20px;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.file-upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.file-upload-btn:active {
    transform: translateY(0);
}

/* ============ 表单反馈消息 ============ */
.form-feedback {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-feedback.success {
    background-color: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #16a34a;
}

.form-feedback.error {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #dc2626;
}

.form-feedback.warning {
    background-color: rgba(234, 179, 8, 0.1);
    border: 1px solid rgba(234, 179, 8, 0.3);
    color: #ca8a04;
}

.form-feedback.info {
    background-color: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: #7c3aed;
}

body.dark .form-feedback.success {
    background-color: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.4);
}

body.dark .form-feedback.error {
    background-color: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
}

body.dark .form-feedback.warning {
    background-color: rgba(234, 179, 8, 0.15);
    border-color: rgba(234, 179, 8, 0.4);
}

body.dark .form-feedback.info {
    background-color: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.4);
}

/* 按钮基础样式 */
.btn {
    padding: 10px 20px;
    font-size: 14px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn:active {
    transform: scale(0.98);
    outline: none;
}

.btn:focus {
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(139, 92, 246, 0.2);
}

.btn-primary.disabled,
.btn-primary:disabled {
    background: #e8e8e8 !important;
    color: #999 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
    opacity: 0.6;
}

.btn-secondary {
    background-color: #f1f5f9;
    color: #666;
}

.btn-secondary:hover {
    background-color: #e2e8f0;
}

.btn-group {
    display: flex;
    gap: 12px;
}

/* ============ 工具页面主要操作按钮样式 ============ */
.btn-purple {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
}

.btn-purple:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.btn-purple:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(139, 92, 246, 0.2);
}

.btn-purple:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-green {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
}

.btn-green:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.btn-red {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.btn-red:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-red:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.2);
}

.btn-red:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 按钮颜色 - 危险（红色别名） */
.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-danger:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.2);
}

.btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-yellow {
    background: linear-gradient(135deg, #eab308, #ca8a04);
    color: white;
}

.btn-yellow:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(234, 179, 8, 0.3);
}

.btn-yellow:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(234, 179, 8, 0.2);
}

.btn-yellow:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-green:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(34, 197, 94, 0.2);
}

.btn-green:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 编辑器按钮 */
.copy-btn,
.example-btn {
    padding: 5px 12px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.copy-btn:hover {
    background: #e8f4ff;
    border-color: #1890ff;
}

.example-btn:hover {
    background: #fff7e6;
    border-color: #fa8c16;
}

/* 工具页面通用按钮样式 */
.btn-xs, .btn.btn-xs, .btn-outline.btn-xs, .settings-card .card-header .btn.btn-xs {
    padding: 3px 8px !important;
    font-size: 12px !important;
}

.btn-sm, .btn.btn-sm, .btn-outline.btn-sm, .settings-card .card-header .btn.btn-sm {
    padding: 6px 12px !important;
    font-size: 13px !important;
}

.btn-md, .btn.btn-md, .btn-outline.btn-md, .settings-card .card-header .btn.btn-md {
    padding: 10px 20px !important;
    font-size: 14px !important;
}

.btn-lg, .btn.btn-lg, .btn-outline.btn-lg, .settings-card .card-header .btn.btn-lg {
    padding: 16px 32px !important;
    font-size: 16px !important;
}

.btn-block {
    width: 100%;
}

.btn-auto {
    width: auto;
    padding: 10px 30px;
    display: inline-block;
}

.btn-clear {
    padding: 6px 12px;
    background: #f3f4f6;
    color: #374151;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-clear:hover {
    background: #e5e7eb;
}

.btn-copy-all {
    padding: 10px 30px;
    background: #8b5cf6;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    width: auto;
    display: inline-block;
}

.btn-copy-all:hover {
    background: #7c3aed;
}

.btn-clear {
    padding: 6px 12px;
    background: #f3f4f6;
    color: #374151;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-clear:hover {
    background: #e5e7eb;
}

/* ============ 描边按钮 ============ */
.btn-outline {
    background: transparent;
    border: 2px solid #8b5cf6;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-outline:hover {
    background: #8b5cf6;
    color: white;
}

.btn-outline-purple {
    color: #8b5cf6;
    border-color: #8b5cf6;
}

.btn-outline-purple:hover {
    background: #8b5cf6;
}

.btn-outline-green {
    color: #22c55e;
    border-color: #22c55e;
}

.btn-outline-green:hover {
    background: #22c55e;
}

.btn-outline-red {
    color: #ef4444;
    border-color: #ef4444;
}

.btn-outline-red:hover {
    background: #ef4444;
}

.btn-outline-yellow {
    color: #eab308;
    border-color: #eab308;
}

.btn-outline-yellow:hover {
    background: #eab308;
}

.btn-outline-cyan {
    color: #06b6d4;
    border-color: #06b6d4;
}

.btn-outline-cyan:hover {
    background: #06b6d4;
}

.btn-outline-orange {
    color: #f97316;
    border-color: #f97316;
}

.btn-outline-orange:hover {
    background: #f97316;
}

.btn-outline-gray {
    color: #6b7280;
    border-color: #d1d5db;
}

.btn-outline-gray:hover {
    background: #ede9fe;
    color: #6b7280;
}

/* 设置项 label 行：label 与右侧小按钮两端对齐 */
.setting-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.setting-label-row .setting-label {
    margin-bottom: 0;
}

/* 通用文字型小按钮（紫色描边） */
.link-btn {
    border: 1px solid #c4b5fd;
    background: #f5f3ff;
    color: #7c3aed;
    padding: 2px 10px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.link-btn:hover:not(:disabled) {
    background: #ede9fe;
}

.link-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============ 卡片头部右侧操作按钮（加载示例等） ============ */
.card-header-right-btn-load {
    padding: 6px 8px;
    font-size: 12px;
    background: transparent;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
    align-items: center;
    gap: 3px;
}

.card-header-right-btn-load:hover {
    background: #f3f4f6;
}

.card-header-right-btn-clear {
    padding: 6px 8px;
    font-size: 12px;
    background: transparent;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.card-header-right-btn-clear:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fecaca;
}

/* ============ 链接按钮 ============ */
.btn-link {
    padding: 0;
    background: transparent;
    color: #8b5cf6;
    border: none;
    border-radius: 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.btn-link:hover {
    color: #7c3aed;
}

/* ============ 更多颜色按钮 ============ */
.btn-cyan {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    color: white;
}

.btn-cyan:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

.btn-cyan:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(6, 182, 212, 0.2);
}

.btn-cyan:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-orange {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: white;
}

.btn-orange:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

.btn-orange:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(249, 115, 22, 0.2);
}

.btn-orange:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============ 按钮组样式 ============ */
.btn-group-horizontal {
    display: flex;
    flex-direction: row;
    gap: 8px;
}

.btn-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-group-horizontal .btn,
.btn-group-vertical .btn {
    flex: none;
}

/* 工具页面通用容器 */

/* 通用卡片样式 */
.tool-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.tool-card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

/* 输入区域 */
.input-section {
    margin-bottom: 20px;
}

.input-label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    display: block;
}

/* 列表项样式（密码、ID、UUID等） */
.item-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.item-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.item-item:hover {
    background: #f3f4f6;
    border-color: #8b5cf6;
}

.item-index {
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    margin-right: 10px;
    flex-shrink: 0;
}

.item-text {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    color: #1f2937;
    word-break: break-all;
    flex: 1;
}

/* 代码显示区域 */
.code-display {
    background: #1e1e1e;
    border-radius: 8px;
    padding: 16px;
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
}

.code-content {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    color: #d4d4d4;
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.6;
}

.code-line-numbers {
    float: left;
    padding-right: 16px;
    border-right: 1px solid #3c3c3c;
    color: #858585;
    text-align: right;
    user-select: none;
    margin-right: 16px;
}

/* 表格样式 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th,
.data-table td {
    border: 1px solid #ddd;
    padding: 8px 12px;
    text-align: left;
}

.data-table th {
    background: #f3f4f6;
    font-weight: 600;
}

.data-table tr:nth-child(even) {
    background: #fff;
}

.data-table tr:nth-child(odd) {
    background: #f9fafb;
}

/* 结果展示区域 */
.result-section {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.result-title {
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 16px;
}

.result-display {
    min-height: 100px;
}

/* 按钮组 */
.btn-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

/* 行内按钮 */
.inline-btn {
    padding: 6px 12px;
    background: #8b5cf6;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    margin-left: 10px;
    flex-shrink: 0;
}

.inline-btn:hover {
    background: #7c3aed;
}

/* 滑块样式 */
.slider {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #e5e7eb;
    border-radius: 3px;
    outline: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #8b5cf6;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.2);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #8b5cf6;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* 密码强度指示器 */
.strength-section {
    margin-bottom: 20px;
}

.strength-label {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
}

.strength-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
}

.strength-fill {
    height: 100%;
    border-radius: 4px;
    transition: all 0.3s;
}

.strength-fill.weak {
    background: #ef4444;
}

.strength-fill.medium {
    background: #f59e0b;
}

.strength-fill.strong {
    background: #10b981;
}

.strength-fill.very-strong {
    background: #8b5cf6;
}

.strength-text {
    font-size: 14px;
    font-weight: 600;
}

.strength-text.weak {
    color: #ef4444;
}

.strength-text.medium {
    color: #f59e0b;
}

.strength-text.strong {
    color: #10b981;
}

.strength-text.very-strong {
    color: #8b5cf6;
}

/* 首页分类样式 */
.content-header {
    margin-bottom: 24px;
}

.content-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.content-desc {
    font-size: 14px;
    color: #888;
}

.category-section {
    margin-bottom: 32px;
}

.category-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-icon {
    font-size: 18px;
}

.tool-list {
    padding: 0 24px;
}

.tool-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    flex-shrink: 0;
}

.tool-card-info h3 {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.tool-card-info p {
    font-size: 12px;
    color: #888;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.empty-state {
    text-align: center;
    padding: 48px;
    color: #888;
}

/* 站点头部 */
.site-header {
    background: #fff;
    border-bottom: 1px solid #eee;
    padding: 12px 24px;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
}

.logo-text {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.header-search {
    flex: 1;
    max-width: 400px;
}

/* 页面布局 */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.wrapper {
    display: flex;
    flex: 1;
}

/* 分类选择器 */
.option-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 15px;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.option-item:hover {
    background-color: #f3f4f6;
}

.option-item input[type="checkbox"]:checked + span,
.option-item input[type="radio"]:checked + span {
    color: #7c3aed;
}

.option-item:has(input[type="checkbox"]:checked),
.option-item:has(input[type="radio"]:checked) {
    background-color: #f3e8ff;
}

.option-item input[type="checkbox"],
.option-item input[type="radio"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #7c3aed;
}

.option-item label {
    font-size: 14px;
    color: #374151;
    cursor: pointer;
}

/* 标题操作区 */
.header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* 下拉框样式 */
.select-wrapper {
    position: relative;
    appearance: none;
    -webkit-appearance: none;
    padding: 10px 30px 10px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    min-width: 120px;
    transition: all 0.2s;
    box-sizing: border-box;
}

.select-wrapper:hover {
    border-color: #d1d5db;
}

.select-wrapper:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.select-wrapper:active {
    background: #f9fafb;
}

.select-wrapper-container {
    position: relative;
    display: inline-block;
}

.select-wrapper-container::after {
    content: '▼';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 10px;
    color: #6b7280;
}

/* 响应式布局 */
@media (max-width: 768px) {
    .tool-container {
        padding: 10px;
    }
    
    .tool-card {
        padding: 16px;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .item-list {
        gap: 8px;
    }
}


.tool-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
}

.tool-header .tool-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 600;
    border-radius: 8px;
    flex-shrink: 0;
    color: white;
}

.tool-header .tool-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.tool-name {
    font-size: 20px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}

.tool-desc {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

/* 面包屑导航 */
.breadcrumb-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    width: 100%;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #6b7280;
    flex-shrink: 0;
}

.breadcrumb-row .tool-desc {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
    text-align: right;
    flex: 0 0 auto;
    padding-left: 20px;
    max-width: 40%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.breadcrumb-item {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-item:hover {
    color: #8b5cf6;
}

.breadcrumb-item.active {
    color: #374151;
    font-weight: 500;
}

.breadcrumb-separator {
    color: #d1d5db;
    font-size: 14px;
}

.tool-container {
    max-width: 1200px;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.result-section {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid #e8e8e8;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.result-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.result-info {
    font-size: 14px;
    color: #666;
}

.result-info.success { color: #059669; }
.result-info.error { color: #dc2626; }
.result-info.info { color: #6366f1; }

.result-code {
    background-color: #1e1e1e;
    color: #d4d4d4;
    padding: 20px;
    border-radius: 8px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 400px;
    overflow-y: auto;
}

body.dark .tool-container {
    background-color: #2d3436;
}

body.dark .form-input,
body.dark .form-textarea,
body.dark .form-select {
    background-color: #1e1e1e;
    border-color: #444;
    color: #e0e0e0;
}

body.dark .form-label {
    color: #e0e0e0;
}

body.dark .tool-name {
    color: #e0e0e0;
}

body.dark .result-title {
    color: #e0e0e0;
}

body.dark .btn-secondary {
    background-color: #3d4446;
    color: #aaa;
}

body.dark .btn-secondary:hover {
    background-color: #4d5456;
}

/* ============ Toast 操作提示组件 ============ */
.toast-container {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast-container.toast-top-right {
    top: 80px;
    right: 24px;
    left: auto;
    transform: none;
}

.toast-container.toast-bottom-right {
    bottom: 24px;
    right: 24px;
    top: auto;
    left: auto;
    transform: none;
}

.toast-container.toast-bottom-left {
    bottom: 24px;
    left: 24px;
    top: auto;
    transform: none;
}

.toast-container.toast-top-left {
    top: 80px;
    left: 24px;
    transform: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
    min-width: 320px;
    max-width: 520px;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    pointer-events: auto;
    border: 2px solid rgba(255,255,255,0.3);
}

.toast-sm {
    padding: 10px 16px;
    min-width: 240px;
    max-width: 400px;
}

.toast-lg {
    padding: 20px 28px;
    min-width: 400px;
    max-width: 600px;
}

.toast.show {
    opacity: 1;
    transform: translateX(0) translateY(0);
}

.toast.hide {
    opacity: 0;
    transform: translateX(0) translateY(-20px);
}

.toast-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.toast-sm .toast-icon {
    width: 24px;
    height: 24px;
    font-size: 14px;
}

.toast-lg .toast-icon {
    width: 40px;
    height: 40px;
    font-size: 20px;
}

.toast-message {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: white;
    line-height: 1.4;
}

.toast-sm .toast-message {
    font-size: 13px;
}

.toast-lg .toast-message {
    font-size: 15px;
}

.toast-close {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.2s;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.2);
}

.toast-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.3);
}

/* ============ Toast 进度条 ============ */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 0 0 10px 10px;
    transition: width 0.1s linear;
}

/* ============ Toast 类型颜色 ============ */
.toast-success {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

.toast-success .toast-icon {
    background: rgba(255, 255, 255, 0.2);
}

.toast-error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.toast-error .toast-icon {
    background: rgba(255, 255, 255, 0.2);
}

.toast-warning {
    background: linear-gradient(135deg, #eab308, #ca8a04);
}

.toast-warning .toast-icon {
    background: rgba(255, 255, 255, 0.2);
}

.toast-info {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.toast-info .toast-icon {
    background: rgba(255, 255, 255, 0.2);
}

.toast-primary {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.toast-primary .toast-icon {
    background: rgba(255, 255, 255, 0.2);
}

body.dark .toast {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* ============ 加载动画组件 ============ */
.loader {
    display: inline-block;
    border-radius: 50%;
    border: 3px solid rgba(139, 92, 246, 0.2);
    border-top-color: #8b5cf6;
    animation: spin 1s linear infinite;
}

.loader-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

.loader-md {
    width: 32px;
    height: 32px;
    border-width: 3px;
}

.loader-lg {
    width: 48px;
    height: 48px;
    border-width: 4px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loader-ring {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.loader-ring::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid rgba(139, 92, 246, 0.2);
}

.loader-ring::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: #8b5cf6;
    animation: spin 1s linear infinite;
}

.loader-ring-sm::before,
.loader-ring-sm::after {
    border-width: 2px;
    width: 20px;
    height: 20px;
}

.loader-ring-md::before,
.loader-ring-md::after {
    border-width: 3px;
    width: 32px;
    height: 32px;
}

.loader-ring-lg::before,
.loader-ring-lg::after {
    border-width: 4px;
    width: 48px;
    height: 48px;
}

/* 加载遮罩 */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 100;
    border-radius: 8px;
}

body.dark .loading-overlay {
    background: rgba(33, 37, 41, 0.8);
}

.loading-text {
    font-size: 14px;
    color: #6b7280;
}

body.dark .loading-text {
    color: #9ca3af;
}

/* ============ 进度条组件 ============ */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-inner {
    height: 100%;
    background: linear-gradient(90deg, #8b5cf6, #7c3aed);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-bar-sm {
    height: 4px;
}

.progress-bar-lg {
    height: 12px;
}

.progress-bar-success .progress-bar-inner {
    background: linear-gradient(90deg, #22c55e, #16a34a);
}

.progress-bar-error .progress-bar-inner {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

.progress-bar-warning .progress-bar-inner {
    background: linear-gradient(90deg, #eab308, #ca8a04);
}

body.dark .progress-bar {
    background: #495057;
}

/* ============ 标签页组件 ============ */
.tabs {
    display: flex;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 20px;
}

.tab-item {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    border: none;
    background: none;
    position: relative;
    transition: color 0.2s;
}

.tab-item:hover {
    color: #8b5cf6;
}

.tab-item.active {
    color: #8b5cf6;
    font-weight: 600;
}

.tab-item.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #8b5cf6;
    border-radius: 2px 2px 0 0;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

body.dark .tabs {
    border-bottom-color: #495057;
}

body.dark .tab-item {
    color: #9ca3af;
}

body.dark .tab-item:hover,
body.dark .tab-item.active {
    color: #a78bfa;
}

body.dark .tab-item.active::after {
    background: #a78bfa;
}

/* ============ 模态框组件（公共 modal 见 public/js/modal.js，下方另有 .modal-overlay 定义） ============ */
.modal {
    background: white;
    border-radius: 12px;
    min-width: 400px;
    max-width: 90%;
    max-height: 80vh;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-overlay.show .modal {
    transform: scale(1);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.modal-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: #f3f4f6;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #6b7280;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #e5e7eb;
}

.modal-body {
    padding: 24px;
    font-size: 14px;
    color: #374151;
    line-height: 1.6;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

body.dark .modal {
    background: #212529;
}

body.dark .modal-header,
body.dark .modal-footer {
    border-color: #495057;
}

body.dark .modal-title {
    color: #fff;
}

body.dark .modal-body {
    color: #e0e0e0;
}

body.dark .modal-close {
    background: #374151;
    color: #9ca3af;
}

body.dark .modal-close:hover {
    background: #495057;
}

/* ============ 徽章/标签组件 ============ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-primary {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.badge-success {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.badge-error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.badge-warning {
    background: rgba(234, 179, 8, 0.1);
    color: #eab308;
}

.badge-info {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.badge-sm {
    padding: 2px 8px;
    font-size: 11px;
}

.badge-lg {
    padding: 6px 16px;
    font-size: 13px;
}

body.dark .badge-primary {
    background: rgba(139, 92, 246, 0.2);
}

body.dark .badge-success {
    background: rgba(34, 197, 94, 0.2);
}

body.dark .badge-error {
    background: rgba(239, 68, 68, 0.2);
}

body.dark .badge-warning {
    background: rgba(234, 179, 8, 0.2);
}

body.dark .badge-info {
    background: rgba(59, 130, 246, 0.2);
}

/* ============ 分隔线组件 ============ */
.divider {
    height: 1px;
    background: #e5e7eb;
    margin: 16px 0;
}

.divider-dashed {
    background: repeating-linear-gradient(
        to right,
        #e5e7eb,
        #e5e7eb 8px,
        transparent 8px,
        transparent 16px
    );
}

.divider-text {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 20px 0;
}

.divider-text::before,
.divider-text::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.divider-text span {
    font-size: 13px;
    color: #6b7280;
    white-space: nowrap;
}

body.dark .divider {
    background: #495057;
}

body.dark .divider-dashed {
    background: repeating-linear-gradient(
        to right,
        #495057,
        #495057 8px,
        transparent 8px,
        transparent 16px
    );
}

body.dark .divider-text::before,
body.dark .divider-text::after {
    background: #495057;
}

body.dark .divider-text span {
    color: #9ca3af;
}

/* ============ 空状态组件 ============ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #9ca3af;
    margin-bottom: 16px;
}

.empty-state-title {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.empty-state-desc {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
    margin-bottom: 20px;
}

.empty-state-action {
    display: flex;
    gap: 12px;
}

body.dark .empty-state-icon {
    background: #374151;
    color: #6b7280;
}

body.dark .empty-state-title {
    color: #fff;
}

body.dark .empty-state-desc {
    color: #9ca3af;
}

/* ============ 内联表单组组件（用于选择器和输入框并排的场景） ============ */
.form-group-inline {
    display: flex;
    align-items: center;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.form-group-inline:focus-within {
    border-color: #8b5cf6;
}

.form-group-inline .setting-input {
    border-left: none !important;
    border-top: none !important;
    border-bottom: none !important;
    border-right: none !important;
    border-radius: 0 8px 8px 0 !important;
    box-shadow: none !important;
}

/* ============ 通用内联选择器（用于和输入框并排的场景） ============ */
.form-select-inline {
    appearance: none;
    -webkit-appearance: none;
    padding: 10px 24px 10px 14px;
    background: #fff;
    border: none;
    border-right: 2px solid #e5e7eb;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    min-width: 110px;
    transition: all 0.2s;
    position: relative;
}

.form-select-inline:hover {
    background: #f9fafb;
}

.form-select-inline:focus {
    outline: none;
}

body.dark .form-select-inline {
    background: #212529;
    color: #e0e0e0;
    border-right-color: #495057;
}

body.dark .form-select-inline:hover {
    background: #374151;
}

/* ============ 代码块组件 ============ */
.code-block {
    margin: 0;
    padding: 16px;
    background: #1e1e1e;
    border-radius: 8px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #d4d4d4;
    white-space: pre-wrap;
    word-break: break-all;
    overflow-x: auto;
}

.code-textarea {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
}

body.dark .code-block {
    background: #2d2d2d;
    color: #d4d4d4;
}

/* ============ 响应体区域 ============ */
.response-body {
    min-height: 200px;
    max-height: 500px;
    overflow-y: auto;
}

.response-stats {
    display: flex;
    gap: 12px;
    align-items: center;
}

.response-time {
    font-size: 13px;
    color: #6b7280;
}

body.dark .response-time {
    color: #9ca3af;
}

/* ============ 参数行组件 ============ */
.param-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ============ 按钮居中容器 ============ */
.btn-container-center {
    display: flex;
    justify-content: center;
    gap: 10px;
}

/* ============ 信息卡片组件 ============ */
.info-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.info-card h4 {
    margin: 0 0 12px 0;
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
}

.info-card ul {
    margin: 0;
    padding-left: 20px;
}

.info-card li {
    margin-bottom: 6px;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.6;
}

.info-card li strong {
    color: #374151;
}

body.dark .info-card {
    background: #212529;
}

body.dark .info-card h4 {
    color: #fff;
}

body.dark .info-card li {
    color: #9ca3af;
}

body.dark .info-card li strong {
    color: #e0e0e0;
}

/* 转换工具通用样式 */
.section-row {
    margin-bottom: 20px;
}

.section-row label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

body.dark .section-row label {
    color: #b8c4c4;
}

.input-field input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
    font-family: Consolas, Monaco, monospace;
}

.input-field input:focus {
    outline: none;
    border-color: #6366f1;
}

body.dark .input-field input {
    background: #212529;
    border-color: #495057;
    color: #fff;
}

.mode-buttons {
    display: flex;
    gap: 8px;
}

.mode-btn {
    padding: 10px 24px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.mode-btn:hover {
    border-color: #6366f1;
    color: #6366f1;
}

.mode-btn.active {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border-color: #6366f1;
}

body.dark .mode-btn {
    background: #212529;
    border-color: #495057;
    color: #b8c4c4;
}

.quick-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quick-btn {
    padding: 8px 16px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: Consolas, Monaco, monospace;
}

.quick-btn:hover,
.quick-btn.active {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border-color: #6366f1;
}

body.dark .quick-btn {
    background: #2d3436;
    border-color: #495057;
    color: #b8c4c4;
}

/* 结果区域样式 */
.convert-result-section {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 25px;
    margin-top: 20px;
}

.convert-result-title {
    font-size: 16px;
    margin-bottom: 15px;
    color: #495057;
}

.convert-result-display {
    text-align: center;
    padding: 30px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 20px;
}

.convert-result-value {
    font-size: 48px;
    font-weight: bold;
    font-family: Consolas, Monaco, monospace;
    letter-spacing: 4px;
    color: #2d3436;
}

body.dark .convert-result-section {
    background: #2d3436;
    border-color: #495057;
}

body.dark .convert-result-title {
    color: #b8c4c4;
}

body.dark .convert-result-display {
    background: #212529;
    border-color: #495057;
}

body.dark .convert-result-value {
    color: #f1f1f1;
}

/* 表格样式 */
.convert-table {
    margin-top: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
}

.convert-table h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 14px;
}

.convert-table-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.convert-table-item {
    background: white;
    padding: 10px;
    border-radius: 6px;
    text-align: center;
    font-size: 13px;
}

.convert-table-item .roman {
    font-size: 18px;
    font-weight: bold;
    font-family: Consolas, Monaco, monospace;
    color: #6366f1;
    margin-bottom: 4px;
}

.convert-table-item .arabic {
    color: #666;
}

body.dark .convert-table {
    background: #2d3436;
}

body.dark .convert-table h4 {
    color: #b8c4c4;
}

body.dark .convert-table-item {
    background: #212529;
}

body.dark .convert-table-item .arabic {
    color: #9ca3af;
}

/* 错误提示 */
.error-msg {
    color: #dc3545;
    font-size: 13px;
    margin-top: 8px;
    display: none;
}

body.dark .error-msg {
    color: #f87171;
}

/* ============ 坐标工具按钮样式 ============ */
.btn-secondary {
    padding: 6px 14px;
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
    transform: translateY(-1px);
}

.btn-secondary.btn-lg {
    padding: 10px 20px;
    font-size: 14px;
}

.btn-danger {
    padding: 6px 14px;
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-danger:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    transform: translateY(-1px);
}

.btn-danger.btn-lg {
    padding: 10px 20px;
    font-size: 14px;
}

.btn-success {
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    color: white;
    transition: all 0.2s ease;
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.coord-card {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

/* ============ 工具页面通用信息说明样式 ============ */
.info-section {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 16px;
}

.info-box {
    background: #f3e8ff;
    border: 1.5px solid #e9d5ff;
    border-radius: 8px;
    padding: 15px;
}

.info-box h4 {
    margin: 0 0 10px 0;
    color: #6b21a8;
    font-size: 15px;
}

.info-box ul {
    margin: 0;
    padding-left: 20px;
}

.info-box li {
    margin-bottom: 8px;
    color: #374151;
    font-size: 13px;
    line-height: 1.6;
}

.info-box p {
    margin: 0 0 12px 0;
    color: #374151;
    font-size: 13px;
    line-height: 1.6;
}

.info-box strong {
    color: #6b21a8;
    font-weight: 600;
}

/* ============ 工具页面通用卡片间距 ============ */
.result-card + .result-card,
.preview-card + .preview-card {
    margin-top: 16px;
}

/* ============ 工具页面通用垂直按钮组 ============ */
.btn-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-group-vertical .btn {
    width: 100%;
}

/* ============ 工具页面通用清空按钮样式 ============ */
.btn-clear {
    padding: 6px 14px;
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-clear:hover:not(:disabled) {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fecaca;
}

.btn-clear:active:not(:disabled) {
    transform: scale(0.98);
}

.btn-clear:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============ 通用紫色勾选框样式 ============ */
input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #8b5cf6;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

input[type="checkbox"]:hover {
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

input[type="checkbox"]:checked {
    background: #8b5cf6;
    border-color: #8b5cf6;
}

input[type="checkbox"]:checked::after {
    content: '';
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.3);
}

.btn-clear.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

.btn-clear.btn-lg {
    padding: 8px 18px;
    font-size: 14px;
}

/* ============ 工具页面通用卡片样式 ============ */
.settings-card, .preview-card, .result-card {
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 15px;
}

.settings-card {
    margin-top: 16px;
}

.settings-card:first-child {
    margin-top: 0;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
    min-height: 44px;
}

/* 卡片头部右侧操作按钮组：统一横向排列与间距 */
.action-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.card-subtitle {
    font-weight: normal;
    font-size: 14px;
    color: #6b7280;
}

.card-header-right {
    display: flex;
    gap: 8px;
}

.setting-item {
    margin-bottom: 15px;
}

.setting-item:last-child {
    margin-bottom: 0;
}

.preview-label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    display: block;
}

.setting-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.setting-input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    box-sizing: border-box;
    transition: all 0.2s;
}

.setting-input:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.settings-card .btn:not(.btn-xs):not(.btn-sm):not(.btn-md):not(.btn-lg) {
    width: 100%;
    padding: 10px 16px;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
}

.settings-card .btn:last-child {
    margin-bottom: 0;
}

.settings-card .card-header .btn {
    width: auto;
    margin-bottom: 0;
}

body.dark .setting-input {
    background: #212529;
    border-color: #495057;
    color: #fff;
}

body.dark .setting-label {
    color: #e0e0e0;
}

body.dark .settings-card,
body.dark .preview-card,
body.dark .result-card {
    background: #212529;
    border-color: #495057;
}

body.dark .card-header {
    border-bottom-color: #495057;
}

body.dark .card-title {
    color: #e0e0e0;
}

body.dark .select-wrapper {
    background: #212529;
    border-color: #495057;
    color: #e0e0e0;
}

body.dark .select-wrapper:hover {
    border-color: #6b7280;
}

body.dark .select-wrapper:active {
    background: #374151;
}

body.dark .select-wrapper-container::after {
    color: #9ca3af;
}

body.dark .option-item label {
    color: #9ca3af;
}

body.dark .card-header-right-btn-load {
    background: #374151;
    border-color: #495057;
    color: #9ca3af;
}

body.dark .card-header-right-btn-load:hover {
    background: #495057;
}

body.dark .card-header-right-btn-clear {
    background: #374151;
    border-color: #495057;
    color: #9ca3af;
}

body.dark .card-header-right-btn-clear:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fecaca;
}

/* ============ 语义化布局类 - 左右布局 ============ */
.section-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
    gap: 20px;
    margin-bottom: 15px;
}

.section-row-1-2 {
    display: grid;
    grid-template-columns: 1fr 2fr;
    grid-template-rows: auto;
    gap: 20px;
    margin-bottom: 15px;
}

.section-row-2-1 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: auto;
    gap: 20px;
    margin-bottom: 15px;
}

.section-row-1-3 {
    display: grid;
    grid-template-columns: 1fr 3fr;
    grid-template-rows: auto;
    gap: 20px;
    margin-bottom: 15px;
}

.section-row-3-1 {
    display: grid;
    grid-template-columns: 3fr 1fr;
    grid-template-rows: auto;
    gap: 20px;
    margin-bottom: 15px;
}

.section-row > div,
.section-row-1-2 > div,
.section-row-2-1 > div,
.section-row-1-3 > div,
.section-row-3-1 > div {
    min-width: 0;
}

/* ============ 语义化布局类 - 上下布局 ============ */
.section-col {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 20px;
    margin-bottom: 15px;
}

.section-col-1-2 {
    display: grid;
    grid-template-rows: 1fr 2fr;
    gap: 20px;
    margin-bottom: 15px;
}

.section-col-2-1 {
    display: grid;
    grid-template-rows: 2fr 1fr;
    gap: 20px;
    margin-bottom: 15px;
}

.section-col-1-3 {
    display: grid;
    grid-template-rows: 1fr 3fr;
    gap: 20px;
    margin-bottom: 15px;
}

.section-col-3-1 {
    display: grid;
    grid-template-rows: 3fr 1fr;
    gap: 20px;
    margin-bottom: 15px;
}

.section-col-auto {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 15px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

.left-panel {
    width: 340px;
    flex-shrink: 0;
}

.right-panel {
    flex: 1;
    min-width: 0;
}

.top-panel {
    flex-shrink: 0;
}

.bottom-panel {
    flex: 1;
    min-height: 0;
}

/* 响应式布局 */
@media (max-width: 768px) {
    .section-row,
    .section-row-1-2,
    .section-row-2-1,
    .section-row-1-3,
    .section-row-3-1 {
        grid-template-columns: 1fr;
    }

    .section-col,
    .section-col-1-2,
    .section-col-2-1,
    .section-col-1-3,
    .section-col-3-1 {
        grid-template-rows: auto;
    }

    .left-panel {
        width: 100%;
    }

    .right-panel {
        min-width: 100%;
    }
}

/* 公共 Modal 弹窗组件（modal.js） */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .82);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 24px;
    backdrop-filter: blur(2px);
}
.modal-content {
    position: relative;
    max-width: 92vw;
    max-height: 86vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.modal-img {
    max-width: 92vw;
    max-height: 78vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
    background: #111;
}
.modal-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #fff;
    color: #111;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .35);
    transition: transform .15s, background .15s;
}
.modal-close:hover {
    background: #7c3aed;
    color: #fff;
    transform: scale(1.08);
}
.modal-toolbar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 16px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, .1);
    border-radius: 999px;
    color: #fff;
    font-size: 13px;
    max-width: 92vw;
    flex-wrap: wrap;
    justify-content: center;
}
.modal-info {
    color: #e5e8f0;
    white-space: nowrap;
}
.modal-nav, .modal-download {
    border: none;
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 13px;
    cursor: pointer;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    transition: background .15s;
}
.modal-nav:hover, .modal-download:hover {
    background: #7c3aed;
}
.modal-download {
    background: #7c3aed;
}
.modal-download:hover {
    background: #6d28d9;
}

/* 工具详情页：相关工具内链区块 */
.related-tools {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #eee;
}
.related-title {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 16px;
}
.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
    align-items: start;
}
.related-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    text-decoration: none;
    color: #333;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.related-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    border-color: #d6bcfa;
}
.related-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
}
.related-name {
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
body.dark .related-tools { border-top-color: #2d3748; }
body.dark .related-card { background: #1a202c; border-color: #2d3748; color: #e2e8f0; }
body.dark .related-title { color: #e2e8f0; }
