/* ========== CSS 变量 ========== */
:root {
    --tc-primary: #059669;
    --tc-primary-hover: #047857;
    --tc-primary-light: #d1fae5;
    --tc-primary-rgb: 5, 150, 105;
    --tc-toolbar-bg: linear-gradient(135deg, #059669 0%, #065f46 100%);
    --tc-toolbar-shadow: rgba(5, 150, 105, 0.35);
    --tc-btn-bg: #ffffff;
    --tc-btn-text: #047857;
    --tc-border: #e2e8f0;
    --tc-text: #1e293b;
    --tc-text-secondary: #64748b;
    --tc-config-bg: #f8fffe;
    --tc-result-bg: #f0fdf4;
    --tc-history-bg: #ffffff;
    --tc-input-bg: #ffffff;
    --tc-input-border: #d1d5db;
    --tc-input-focus: #059669;
    --tc-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --tc-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --tc-radius: 8px;
}

/* ========== 暗黑模式变量 ========== */
.tc-dark {
    --tc-primary: #34d399;
    --tc-primary-hover: #10b981;
    --tc-primary-light: #064e3b;
    --tc-primary-rgb: 52, 211, 153;
    --tc-toolbar-bg: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
    --tc-toolbar-shadow: rgba(6, 78, 59, 0.5);
    --tc-btn-bg: #334155;
    --tc-btn-text: #34d399;
    --tc-border: #334155;
    --tc-text: #f1f5f9;
    --tc-text-secondary: #94a3b8;
    --tc-config-bg: #0f172a;
    --tc-result-bg: #021f14;
    --tc-history-bg: #1e293b;
    --tc-input-bg: #1e293b;
    --tc-input-border: #475569;
    --tc-input-focus: #34d399;
    --tc-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    --tc-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
}

/* ========== 容器 ========== */
.tc-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: #f8fafc;
    border-radius: var(--tc-radius);
    overflow: hidden;
    box-shadow: var(--tc-shadow);
    transition: box-shadow 0.3s ease, background 0.3s ease;
}

.tc-dark.tc-container,
.tc-dark .tc-container {
    background: #0f172a;
}

.tc-container.tc-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
}

/* ========== 工具栏 ========== */
.tc-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: var(--tc-toolbar-bg);
    color: white;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: 0 2px 10px var(--tc-toolbar-shadow);
    flex-shrink: 0;
    transition: background 0.3s ease;
}

.toolbar-group {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    min-height: 28px;
}

.toolbar-btn {
    padding: 6px 11px;
    background: var(--tc-btn-bg);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: var(--tc-btn-text);
    transition: transform 0.18s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.18s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.18s;
    white-space: nowrap;
}

.toolbar-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}

.toolbar-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: none;
}

.toolbar-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ========== 主内容区 ========== */
.tc-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: var(--tc-config-bg);
    transition: background 0.3s ease;
}

/* ========== 左侧历史面板 ========== */
.tc-history-panel {
    width: 210px;
    background: var(--tc-history-bg);
    border-right: 1px solid var(--tc-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: linear-gradient(to bottom, #fafafa, #f5f5f5);
    border-bottom: 1px solid var(--tc-border);
    flex-shrink: 0;
    transition: background 0.3s ease;
}

.tc-dark .history-header {
    background: linear-gradient(to bottom, #1e293b, #162032);
}

.history-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--tc-text-secondary);
}

.history-clear-btn {
    background: #fff0f0;
    border: none;
    color: #ef4444;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 7px;
    border-radius: 4px;
    transition: background 0.2s;
    white-space: nowrap;
}

.history-clear-btn:hover {
    background: #fde8e8;
}

.tc-dark .history-clear-btn {
    background: rgba(239, 68, 68, 0.15);
}

.history-search {
    padding: 8px 10px;
    border-bottom: 1px solid var(--tc-border);
    flex-shrink: 0;
}

.history-search input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--tc-input-border);
    border-radius: 5px;
    font-size: 12px;
    outline: none;
    background: var(--tc-input-bg);
    color: var(--tc-text);
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.history-search input:focus {
    border-color: var(--tc-input-focus);
    box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.12);
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.history-list::-webkit-scrollbar { width: 4px; }
.history-list::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }

.history-empty {
    padding: 18px;
    text-align: center;
    font-size: 12px;
    color: #94a3b8;
}

.history-item {
    padding: 9px 11px;
    margin-bottom: 4px;
    background: #f8fafc;
    border: 1px solid var(--tc-border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.tc-dark .history-item {
    background: #1e293b;
    border-color: #334155;
}

.history-item:hover {
    background: #f0fdf4;
    border-color: #6ee7b7;
    transform: translateX(2px);
}

.tc-dark .history-item:hover {
    background: #133929;
    border-color: #34d399;
}

.history-item.active {
    background: var(--tc-primary-light);
    border-color: var(--tc-primary);
    box-shadow: 0 1px 4px rgba(5, 150, 105, 0.18);
}

.history-item-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--tc-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 3px;
}

.history-item-meta {
    font-size: 11px;
    color: var(--tc-text-secondary);
    display: flex;
    gap: 6px;
}

.history-item-del {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    background: #fde8e8;
    color: #ef4444;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.history-item:hover .history-item-del {
    opacity: 1;
}

.history-item-del:hover {
    background: #ef4444;
    color: white;
}

/* ========== 中间配置面板 ========== */
.tc-config-panel {
    width: 360px;
    background: var(--tc-config-bg);
    border-right: 1px solid var(--tc-border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex-shrink: 0;
    padding: 14px 16px;
    gap: 0;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
    transition: background 0.3s ease;
}

.tc-config-panel::-webkit-scrollbar { width: 4px; }
.tc-config-panel::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }

.config-section {
    margin-bottom: 14px;
}

.config-section.half {
    flex: 1;
    margin-bottom: 0;
}

.config-row {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
}

.config-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 600;
    color: var(--tc-text);
}

.optional-badge {
    font-size: 10px;
    font-weight: 400;
    color: var(--tc-text-secondary);
    background: rgba(100, 116, 139, 0.12);
    padding: 1px 6px;
    border-radius: 8px;
    margin-left: 4px;
}

/* ========== 导入示例条 ========== */
.tc-example-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.tc-example-label {
    font-size: 11px;
    color: var(--tc-text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
}

.tc-example-chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    background: var(--tc-primary-light);
    border: 1px solid rgba(5, 150, 105, 0.3);
    border-radius: 12px;
    font-size: 11px;
    color: var(--tc-primary);
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    white-space: nowrap;
}

.tc-example-chip:hover {
    background: rgba(5, 150, 105, 0.18);
    border-color: var(--tc-primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(5, 150, 105, 0.18);
}

.tc-example-chip.ael-active {
    background: var(--tc-primary);
    color: #fff;
    border-color: var(--tc-primary);
    transform: scale(0.95);
}

.tc-dark .tc-example-chip {
    background: rgba(52, 211, 153, 0.1);
    border-color: rgba(52, 211, 153, 0.25);
    color: var(--tc-primary);
}

.tc-dark .tc-example-chip:hover {
    background: rgba(52, 211, 153, 0.2);
    border-color: var(--tc-primary);
}

.tc-dark .tc-example-chip.ael-active {
    background: var(--tc-primary);
    color: #0f172a;
    border-color: var(--tc-primary);
}

.char-count {
    font-size: 11px;
    font-weight: 400;
    color: var(--tc-text-secondary);
    transition: color 0.2s;
}

.char-count.warn { color: #ef4444; }
.char-count.orange { color: #f97316; }
.char-count.ok { color: var(--tc-primary); }

/* ========== Textarea ========== */
.textarea-wrapper {
    position: relative;
}

.tc-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--tc-input-border);
    border-radius: var(--tc-radius);
    font-size: 13px;
    line-height: 1.6;
    font-family: inherit;
    resize: vertical;
    outline: none;
    background: var(--tc-input-bg);
    color: var(--tc-text);
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.tc-textarea:focus {
    border-color: var(--tc-input-focus);
    box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.12);
}

.tc-textarea::placeholder {
    color: #9ca3af;
    font-size: 12px;
}

.feature-textarea {
    min-height: 96px;
}

.background-textarea {
    min-height: 56px;
}

.copy-input-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    padding: 3px 8px;
    background: rgba(5, 150, 105, 0.1);
    border: 1px solid rgba(5, 150, 105, 0.25);
    border-radius: 4px;
    font-size: 11px;
    color: var(--tc-primary);
    cursor: pointer;
    transition: all 0.18s;
}

.copy-input-btn:hover {
    background: var(--tc-primary);
    color: white;
}

.copy-input-btn.hidden {
    opacity: 0;
    pointer-events: none;
}

/* ========== 测试类型卡片 ========== */
.type-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 7px;
}

.type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px;
    background: var(--tc-input-bg);
    border: 1.5px solid var(--tc-border);
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    user-select: none;
}

.type-card:hover {
    border-color: var(--tc-primary);
    background: var(--tc-primary-light);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(5, 150, 105, 0.14);
}

.type-card.active {
    border-color: var(--tc-primary);
    background: var(--tc-primary-light);
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.2);
}

.type-icon {
    font-size: 18px;
    margin-bottom: 3px;
    display: block;
}

.type-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--tc-text);
    margin-bottom: 1px;
    display: block;
}

.type-desc {
    font-size: 10px;
    color: var(--tc-text-secondary);
    display: block;
}

/* ========== Select ========== */
.tc-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--tc-input-border);
    border-radius: 6px;
    font-size: 13px;
    background: var(--tc-input-bg);
    color: var(--tc-text);
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
    appearance: auto;
}

.tc-select:focus {
    border-color: var(--tc-input-focus);
    box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.12);
}

/* ========== 数量控制 ========== */
.count-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.count-btn {
    width: 28px;
    height: 28px;
    border: 1.5px solid var(--tc-primary);
    background: transparent;
    color: var(--tc-primary);
    border-radius: 6px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s;
    padding: 0;
}

.count-btn:hover:not(:disabled) {
    background: var(--tc-primary);
    color: white;
    transform: scale(1.08);
}

.count-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.count-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--tc-primary);
    min-width: 30px;
    text-align: center;
    cursor: pointer;
}

@keyframes tc-num-pop {
    from { transform: scale(0.86); }
    50% { transform: scale(1.07); }
    to { transform: scale(1); }
}

.count-value.pop {
    animation: tc-num-pop 0.42s cubic-bezier(0.4, 0, 0.2, 1);
}

.count-unit {
    font-size: 13px;
    color: var(--tc-text-secondary);
}

/* ========== 生成按钮 ========== */
.generate-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
    margin-bottom: 12px;
}

.generate-btn {
    width: 100%;
    padding: 12px 16px;
    background: var(--tc-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.generate-btn:hover:not(:disabled) {
    background: var(--tc-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(5, 150, 105, 0.35);
}

.generate-btn:active:not(:disabled) {
    transform: translateY(0);
}

.generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-spinner {
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

.btn-spinner.hidden {
    opacity: 0;
    width: 0;
    margin: 0;
    padding: 0;
    border: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.kbd-hint {
    font-size: 11px;
    opacity: 0.8;
    margin-left: 4px;
}

.kbd-hint kbd {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 3px;
    padding: 1px 4px;
    font-family: inherit;
    font-size: 10px;
}

.cancel-btn {
    width: 100%;
    padding: 8px;
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    max-height: 50px;
    overflow: hidden;
    transition: background 0.18s, color 0.18s, opacity 0.25s, transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                max-height 0.2s ease, padding 0.2s ease;
    transform-origin: top center;
}

.cancel-btn:hover {
    background: #dc2626;
    color: white;
}

.cancel-btn.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scaleY(0);
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin: 0;
    border-top-width: 0;
    border-bottom-width: 0;
    overflow: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, max-height 0.2s ease, padding 0.2s ease;
}

/* ========== 提示栏 ========== */
.hint-bar {
    padding: 8px 12px;
    background: rgba(5, 150, 105, 0.07);
    border: 1px solid rgba(5, 150, 105, 0.15);
    border-radius: 6px;
    font-size: 12px;
    color: var(--tc-text-secondary);
    line-height: 1.6;
}

.hint-bar strong {
    color: var(--tc-primary);
}

/* ========== 右侧结果面板 ========== */
.tc-result-panel {
    flex: 1;
    background: var(--tc-result-bg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: background 0.3s ease;
    min-width: 0;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(to bottom, #f0fdf4, #ecfdf5);
    border-bottom: 1px solid var(--tc-border);
    flex-shrink: 0;
    transition: background 0.3s ease;
}

.tc-dark .result-header {
    background: linear-gradient(to bottom, #0a2e1e, #021f14);
}

.result-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--tc-text);
}

.result-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-actions.hidden {
    opacity: 0;
    pointer-events: none;
}

.tc-badge {
    background: var(--tc-primary-light);
    color: var(--tc-primary);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid rgba(5, 150, 105, 0.2);
}

.result-btn {
    padding: 4px 9px;
    background: var(--tc-input-bg);
    border: 1px solid var(--tc-border);
    border-radius: 5px;
    font-size: 11px;
    color: var(--tc-text-secondary);
    cursor: pointer;
    transition: all 0.18s;
    white-space: nowrap;
}

.result-btn:hover {
    border-color: var(--tc-primary);
    color: var(--tc-primary);
    background: var(--tc-primary-light);
}

.result-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.result-body::-webkit-scrollbar { width: 4px; }
.result-body::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }

/* ========== 空状态 ========== */
.empty-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    gap: 12px;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.empty-icon {
    font-size: 52px;
    opacity: 0.4;
}

.empty-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--tc-text-secondary);
}

.empty-hint {
    font-size: 13px;
    color: var(--tc-text-secondary);
    opacity: 0.7;
    text-align: center;
    max-width: 280px;
}

/* ========== 测试用例卡片 ========== */
.tc-card {
    background: var(--tc-input-bg);
    border: 1.5px solid var(--tc-border);
    border-radius: 10px;
    margin-bottom: 10px;
    overflow: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    animation: cardIn 0.32s ease forwards;
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.tc-card:hover {
    border-color: #6ee7b7;
    box-shadow: 0 3px 10px rgba(5, 150, 105, 0.1);
    transform: translateY(-1px);
}

.tc-dark .tc-card {
    background: #1e293b;
    border-color: #334155;
}

.tc-card.collapsed .card-body {
    display: none;
}

/* 卡片头 */
.card-header {
    display: flex;
    align-items: center;
    padding: 11px 14px;
    cursor: pointer;
    gap: 9px;
    background: transparent;
    transition: background 0.15s;
    user-select: none;
}

.card-header:hover {
    background: rgba(5, 150, 105, 0.04);
}

.card-id {
    font-size: 11px;
    font-weight: 700;
    color: white;
    background: var(--tc-primary);
    padding: 2px 7px;
    border-radius: 5px;
    flex-shrink: 0;
}

.card-title {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: var(--tc-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-priority {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
    flex-shrink: 0;
}

.priority-p0 { background: #fee2e2; color: #dc2626; }
.priority-p1 { background: #fef3c7; color: #d97706; }
.priority-p2 { background: #f0fdf4; color: #16a34a; }

.card-tags {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.card-tag {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 10px;
    border: 1px solid rgba(5, 150, 105, 0.25);
    color: var(--tc-primary);
    background: var(--tc-primary-light);
}

.card-toggle {
    font-size: 12px;
    color: var(--tc-text-secondary);
    flex-shrink: 0;
    transition: transform 0.2s;
}

.tc-card.collapsed .card-toggle {
    transform: rotate(-90deg);
}

/* 卡片内容 */
.card-body {
    padding: 0 14px 14px;
    border-top: 1px solid var(--tc-border);
}

.card-section {
    margin-top: 10px;
}

.card-section-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--tc-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-section-content {
    font-size: 13px;
    color: var(--tc-text);
    line-height: 1.6;
}

.steps-list {
    margin: 0;
    padding-left: 18px;
}

.steps-list li {
    margin-bottom: 3px;
    font-size: 13px;
    color: var(--tc-text);
}

/* 代码块 */
.code-block-wrapper {
    position: relative;
    margin-top: 5px;
}

.code-block {
    background: #0f172a;
    color: #e2e8f0;
    padding: 12px 14px;
    border-radius: 6px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.7;
    overflow-x: auto;
    max-height: 220px;
    white-space: pre;
    scrollbar-width: thin;
    scrollbar-color: #334155 transparent;
}

.code-block::-webkit-scrollbar { height: 4px; width: 4px; }
.code-block::-webkit-scrollbar-thumb { background: #334155; border-radius: 2px; }

.copy-code-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #94a3b8;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.18s;
}

.copy-code-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    color: white;
}

/* 卡片底部操作 */
.card-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--tc-border);
    gap: 8px;
}

.card-copy-btn {
    padding: 4px 10px;
    background: rgba(5, 150, 105, 0.08);
    border: 1px solid rgba(5, 150, 105, 0.2);
    border-radius: 5px;
    font-size: 11px;
    color: var(--tc-primary);
    cursor: pointer;
    transition: all 0.18s;
}

.card-copy-btn:hover {
    background: var(--tc-primary);
    color: white;
}

/* ========== 结果入场动画（首次显示）========== */
@keyframes tcFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.tc-result-anim {
    animation: tcFadeIn 0.32s ease forwards;
}

/* ========== Toast ========== */
.tc-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 10px 20px;
    background: #1e293b;
    color: white;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 340px;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}

.tc-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.tc-toast.success { background: var(--tc-primary); }
.tc-toast.error { background: #dc2626; }
.tc-toast.warning { background: #d97706; }

/* ========== 响应式 ========== */
@media (max-width: 900px) {
    .tc-history-panel {
        display: none;
    }
    .type-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 700px) {
    .tc-config-panel {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--tc-border);
    }
    .tc-main-content {
        flex-direction: column;
    }
    .type-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .config-row {
        flex-direction: column;
    }
}
