/* 基础样式重置 (已限制在 #tool 作用域，避免污染 v2 shell) */
#tool * { box-sizing: border-box; }

/* 全局变量 - 简洁克制的配色 */
:root {
    --primary-color: #2563eb;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --bg-white: #ffffff;
    --bg-gray: #f9fafb;
    --bg-light: #f3f4f6;
    --success-color: #10b981;
    --error-color: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

#tool {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部 */
.header {
    background-color: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    padding: 30px 0;
    margin-bottom: 30px;
}

.header-content {
    text-align: center;
}

.site-title {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.site-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 400;
}

/* 介绍区域 */
.intro-section {
    background-color: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.intro-content h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.intro-content p {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.intro-content p:last-child {
    margin-bottom: 0;
}

/* 主工作区 */
.main-workspace {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

/* 控制面板 */
.control-panel {
    display: flex;
    flex-direction: column;
}

.panel-card {
    background-color: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 30px;
    border: 1px solid var(--border-color);
}

.panel-card h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 25px;
}

/* 输入组 */
.input-group {
    margin-bottom: 25px;
}

.input-group label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.input-group input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--bg-light);
}

.input-group input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-white);
}

.input-hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
    line-height: 1.5;
}

/* 风格按钮网格 */
.style-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.style-btn {
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    color: var(--text-primary);
}

.style-btn:hover {
    border-color: var(--primary-color);
    background: var(--bg-white);
}

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

/* 滑块 */
.size-value {
    color: var(--primary-color);
    font-weight: 700;
}

.slider {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: var(--border-color);
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: var(--shadow-md);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
    box-shadow: var(--shadow-md);
}

/* 颜色控制 */
.color-controls {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.color-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 12px;
}

.color-picker-container {
    display: flex;
    gap: 10px;
    align-items: stretch;
    margin-bottom: 10px;
}

.color-display {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-sm);
    border: 3px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.color-display:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.color-picker-container input[type="color"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.color-picker-container input[type="text"] {
    flex: 1;
    padding: 12px 14px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
    background: var(--bg-light);
    text-transform: uppercase;
}

.color-picker-container input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-white);
}

/* 快捷颜色按钮 */
.quick-colors {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
}

.quick-color-btn {
    width: 100%;
    aspect-ratio: 1;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.quick-color-btn:hover {
    transform: scale(1.15);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.quick-color-btn[data-color="#ffffff"] {
    border-color: #d1d5db;
}

/* 操作按钮 */
.action-buttons {
    display: flex;
    gap: 12px;
    margin-top: 30px;
}

.btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover:not(:disabled) {
    background: #1d4ed8;
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-white);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

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

/* 预览区域 */
.preview-section {
    position: sticky;
    top: 20px;
}

.preview-card {
    background-color: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 30px;
    border: 1px solid var(--border-color);
}

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

.preview-header h3 {
    font-size: 20px;
    font-weight: 600;
}

.info-badge {
    display: inline-block;
    padding: 6px 12px;
    background: var(--bg-light);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.preview-container {
    position: relative;
    min-height: 400px;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
    border: 2px dashed var(--border-color);
}

.placeholder {
    text-align: center;
    color: var(--text-secondary);
}

.placeholder p {
    font-size: 1.1rem;
}

.loading {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.loading.show {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

#signatureImage {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

/* 使用说明 */
.guide-section {
    background-color: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.guide-section h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.guide-content {
    display: grid;
    gap: 20px;
}

.guide-step {
    padding: 20px;
    background-color: var(--bg-light);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--primary-color);
}

.guide-step h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.guide-step p {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* 功能特点 */
.features-section {
    background-color: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.features-section h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.feature-item {
    padding: 20px;
    background-color: var(--bg-light);
    border-radius: var(--radius-md);
}

.feature-item h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.feature-item p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* 签名风格介绍 */
.styles-section {
    background-color: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.styles-section h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.styles-content {
    display: grid;
    gap: 16px;
}

.style-intro {
    padding: 20px;
    background-color: var(--bg-light);
    border-radius: var(--radius-md);
}

.style-intro h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.style-intro p {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* 使用示例 */
.examples-section {
    background-color: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.examples-section h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.example-item {
    padding: 20px;
    background-color: var(--bg-light);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

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

.example-item h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.example-item p {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* 常见问题 */
.faq-section {
    background-color: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.faq-section h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.faq-list {
    display: grid;
    gap: 16px;
}

.faq-item {
    padding: 20px;
    background-color: var(--bg-light);
    border-radius: var(--radius-md);
}

.faq-item h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.faq-item p {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* 适用场景 */
.scenarios-section {
    background-color: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.scenarios-section h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.scenarios-list {
    list-style: none;
    padding: 0;
}

.scenarios-list li {
    padding: 12px 0;
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.scenarios-list li:last-child {
    border-bottom: none;
}

.scenarios-list strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* 使用技巧 */
.tips-section {
    background-color: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.tips-section h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.tips-content {
    display: grid;
    gap: 16px;
}

.tip-item {
    padding: 20px;
    background-color: var(--bg-light);
    border-radius: var(--radius-md);
}

.tip-item h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.tip-item p {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* 相关工具推荐 */
.related-tools-section {
    background-color: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.related-tools-section h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.section-desc {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.related-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.tool-card {
    display: block;
    padding: 20px;
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all 0.2s;
}

.tool-card:hover {
    border-color: var(--primary-color);
    background-color: var(--bg-white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.tool-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.tool-card p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0;
}

/* 页脚 */
.footer {
    background-color: var(--bg-white);
    border-top: 1px solid var(--border-color);
    padding: 30px 0;
    margin-top: 40px;
}

.footer-content {
    text-align: center;
}

.footer-content p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.footer-links a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

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

.footer-links span {
    color: var(--text-secondary);
}

/* Toast 通知 */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--primary-color);
    color: white;
    padding: 16px 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    transform: translateY(120px);
    transition: transform 0.3s ease;
    z-index: 1000;
}

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

/* 响应式设计 */
@media (max-width: 1024px) {
    .main-workspace {
        grid-template-columns: 1fr;
    }

    .preview-section {
        position: static;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .site-title {
        font-size: 24px;
    }

    .panel-card {
        padding: 20px;
    }

    .style-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .action-buttons {
        flex-direction: column;
    }

    .toast {
        right: 15px;
        bottom: 15px;
        left: 15px;
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: 20px;
    }

    .site-subtitle {
        font-size: 14px;
    }

    .quick-colors {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }

    .color-display {
        width: 45px;
        height: 45px;
    }
}
