#app {
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.section-row-1-3 {
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .section-row-1-3 {
        grid-template-columns: 1fr;
    }
}

.settings-card .btn-container-center .btn {
    width: auto;
}

.style-card .style-tab-content {
    display: block;
}

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

.header-section {
    text-align: center;
    margin-bottom: 20px;
}

.header-section h1 {
    font-size: 24px;
    margin: 0 0 8px 0;
    color: #1a1a1a;
}

.header-section p {
    color: #666;
    margin: 0;
    font-size: 14px;
}

.preview-section {
    margin-bottom: 15px;
}

.settings-card, .preview-card, .style-card, .data-card {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 15px;
}

.style-card {
    margin-top: 12px;
}

.style-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.style-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.style-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.style-item.full-width {
    grid-column: span 2;
}

.checkbox-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.style-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: nowrap;
}

.style-tab-btn {
    padding: 6px 12px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #6b7280;
    transition: all 0.2s;
    white-space: nowrap;
}

.style-tab-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

.style-tab-btn.active {
    background: #8b5cf6;
    border-color: #8b5cf6;
    color: white;
}

.style-tab-content {
    margin-top: 12px;
}

.color-input {
    width: 100%;
    height: 40px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
}

.color-input-small {
    width: 40px;
    height: 32px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
}

.color-picker-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.color-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
    flex-shrink: 0;
}

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

.toggle-switch .toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #d1d5db;
    transition: background-color 0.3s ease;
    border-radius: 30px;
    border: 2px solid #d1d5db;
}

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

.toggle-switch input:checked + .toggle-slider {
    background-color: #8b5cf6;
    border-color: #8b5cf6;
}

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

.toggle-switch:hover .toggle-slider {
    background-color: #9ca3af;
}

.toggle-switch input:checked:hover + .toggle-slider {
    background-color: #7c3aed;
}

.number-input-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.number-btn {
    width: 30px;
    height: 32px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.number-input {
    width: 60px;
    height: 32px;
    text-align: center;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
}

.position-buttons {
    display: flex;
    gap: 4px;
}

.pos-btn {
    flex: 1;
    padding: 6px 8px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}

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

.pos-btn.active {
    background: #8b5cf6;
    border-color: #8b5cf6;
    color: white;
}

.data-card {
    margin-top: 12px;
}

.header-clear {
    padding: 4px 10px;
    background: #f5f3ff;
    color: #7c3aed;
    border: 1px solid #e9d5ff;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.header-clear:hover:not(:disabled) {
    background: #ede9fe;
    border-color: #8b5cf6;
}

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

.size-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.size-inputs .text-input {
    width: 100px;
    text-align: center;
}

.size-separator {
    font-size: 16px;
    font-weight: 600;
    color: #9ca3af;
}

.size-unit {
    font-size: 14px;
    font-weight: 500;
    color: #9ca3af;
    margin-left: 8px;
}

.size-inputs-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.size-inputs-row > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.size-inputs-row label {
    font-size: 11px;
    color: #6b7280;
}

.size-inputs-row .text-input {
    width: 80px;
    text-align: center;
}

.size-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.size-presets button {
    padding: 4px 10px;
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.size-presets button:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.range-input {
    width: 100%;
    height: 6px;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background: #e5e7eb;
    border-radius: 3px;
}

.range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(139, 92, 246, 0.3);
}

.range-input::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(139, 92, 246, 0.3);
}

.range-value {
    display: inline-block;
    margin-left: 10px;
    font-size: 12px;
    color: #888;
    font-weight: 500;
}

.text-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
}

.text-input:focus {
    border-color: #8b5cf6;
}

.format-select {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
    outline: none;
    box-sizing: border-box;
}

.format-select:focus {
    border-color: #8b5cf6;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #555;
}

.preset-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.preset-buttons button {
    padding: 6px 8px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
}

.preset-buttons button:hover {
    background: #f3f4f6;
}

.toggle-group {
    display: inline-flex;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}

.toggle-btn {
    padding: 6px 14px;
    background: #f3f4f6;
    border: none;
    cursor: pointer;
    font-size: 13px;
    color: #6b7280;
    transition: all 0.2s;
}

.toggle-btn + .toggle-btn {
    border-left: 1px solid #e5e7eb;
}

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

.toggle-btn.active {
    background: #8b5cf6;
    color: #fff;
}

.divider {
    height: 1px;
    background: #e5e7eb;
    margin: 16px 0;
}

.btn-container-center {
    display: flex;
    justify-content: center;
    margin-top: 8px;
}

.btn {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-purple:hover:not(:disabled) {
    opacity: 0.95;
}

.btn-secondary:hover:not(:disabled) {
    background: #e5e7eb;
}

.info-text {
    padding: 12px;
    font-size: 12px;
    color: #666;
    background: #f9fafb;
    border-radius: 6px;
    margin-top: 12px;
}

.chart-container {
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 280px;
}

.chart-container canvas {
    max-width: 100%;
    height: auto;
}

.table-wrapper {
    max-height: 250px;
    overflow-y: auto;
    margin-bottom: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.data-table th {
    padding: 8px 10px;
    text-align: left;
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
    position: sticky;
    top: 0;
}

.data-table td {
    padding: 6px 10px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.data-table tr:hover td {
    background: #fafafa;
}

.data-table td input[type="text"],
.data-table td input[type="number"] {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
}

.data-table td input[type="text"]:focus,
.data-table td input[type="number"]:focus {
    border-color: #8b5cf6;
}

.data-table td input[type="color"] {
    width: 28px;
    height: 24px;
    border: 1px solid #e5e7eb;
    border-radius: 3px;
    cursor: pointer;
}

.data-table td button {
    padding: 2px 5px;
    margin-right: 2px;
    border: none;
    border-radius: 2px;
    background: #f3f4f6;
    cursor: pointer;
    font-size: 11px;
}

.data-table td button:hover:not(:disabled) {
    background: #e5e7eb;
}

.data-table td button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.data-table td button.delete-btn {
    background: #fee2e2;
    color: #dc2626;
}

.data-table td button.delete-btn:hover:not(:disabled) {
    background: #fecaca;
}

.add-row-btn {
    width: 100%;
    padding: 8px;
    border: 1px dashed #d1d5db;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 12px;
    color: #6b7280;
    transition: all 0.2s;
}

.add-row-btn:hover {
    border-color: #9ca3af;
    color: #374151;
}

.context-menu {
    position: fixed;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 8px;
    z-index: 1000;
    min-width: 120px;
}

.context-menu button {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
    font-size: 13px;
    color: #374151;
    border-radius: 4px;
}

.context-menu button:hover {
    background: #f3f4f6;
}

.context-menu hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 8px 0;
}

.context-menu button.danger-btn {
    color: #dc2626;
}

.context-menu button.danger-btn:hover {
    background: #fef2f2;
}

.title-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.title-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.title-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.title-input {
    width: 100%;
}

.color-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.color-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.color-row-2 {
    grid-template-columns: 3fr 1fr;
}

.color-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.color-item-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    background: #f9fafb;
    border-radius: 8px;
}

.color-item-inner span {
    text-align: left;
}

.theme-buttons {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    margin-top: 4px;
}

/* 颜色主题色块按钮（纯自定义，无 btn 依赖） */
.theme-swatch {
    display: inline-flex;
    width: 44px;
    height: 22px;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
    background: transparent;
    cursor: pointer;
    overflow: hidden;
    padding: 0;
    flex-shrink: 0;
}

.theme-swatch i {
    flex: 1;
    height: 100%;
}

.theme-swatch.active {
    border-width: 3px;
    border-color: #8b5cf6;
}

.label-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.label-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.label-row.single {
    grid-template-columns: 1fr;
}

.label-item.full-width {
    grid-column: span 3;
}

.label-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

.mode-btn {
    flex: 1;
    padding: 6px 8px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    color: #6b7280;
    transition: all 0.2s;
}

.mode-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

.mode-btn.active {
    background: #8b5cf6;
    border-color: #8b5cf6;
    color: white;
}

.legend-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.legend-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.legend-row:last-child {
    grid-template-columns: 1fr;
}

.legend-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.legend-item.full-width {
    grid-column: span 3;
}

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

.shape-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    color: #6b7280;
    transition: all 0.2s;
}

.shape-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

.shape-btn.active {
    background: #8b5cf6;
    border-color: #8b5cf6;
    color: white;
}

.watermark-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.watermark-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.watermark-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.watermark-item.full-width {
    grid-column: span 1;
}

.other-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.other-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.other-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ============ 工具页面通用布局样式（继承 common.css card-header） ============ */
.result-card {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 15px;
}

/* 紫色主题 header 按钮 */
.card-header-right-btn-purple {
    padding: 6px 8px;
    font-size: 12px;
    background: #8b5cf6;
    border: 1px solid #8b5cf6;
    border-radius: 6px;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.card-header-right-btn-purple:hover:not(:disabled) {
    background: #7c3aed;
    border-color: #7c3aed;
}

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

/* 覆盖 common.css 的 .tab-content { display:none }，本工具用 v-show 控制 */
.style-card .style-tab-content {
    display: block;
}

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

/* 导出按钮不铺满，居中显示 */
.btn-container-center .btn {
    width: auto !important;
}

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

.input-textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Consolas', 'Monaco', monospace;
    resize: vertical;
    outline: none;
    box-sizing: border-box;
}

.input-textarea:focus {
    border-color: #8b5cf6;
}

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

/* ============ 工具页面通用按钮样式 ============ */
.btn-group {
    display: flex;
    gap: 12px;
}

.btn-group .btn {
    flex: 1;
}

.btn-primary {
    padding: 12px 24px;
    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;
    -webkit-tap-highlight-color: transparent;
}

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

.btn-primary:active {
    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;
    transform: none;
    box-shadow: none;
    opacity: 0.6;
}

.btn-secondary {
    padding: 12px 24px;
    background: #f3f4f6;
    color: #374151;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

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

.btn-purple {
    padding: 12px 24px;
    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;
}

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

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

/* ============ 工具页面空状态样式 ============ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #9ca3af;
    text-align: center;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

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

/* ============ 功能说明/注意事项样式继承 common.css 公共（紫色）样式 ============ */

/* ============ 工具页面响应式布局 ============ */
@media (max-width: 768px) {
    .section-row {
        grid-template-columns: 1fr;
    }
}
