/* ========== 垃圾分类工具 - 主容器 ========== */
.ts-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: #f0faf4;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

/* 全屏模式 */
.ts-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
}

/* ========== 顶部工具栏 ========== */
.ts-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: linear-gradient(135deg, #2d7d46 0%, #1b5e20 100%);
    border-bottom: none;
    color: white;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(45, 125, 70, 0.35);
    flex-shrink: 0;
}

.toolbar-group {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    min-height: 28px;
}

.toolbar-group--right {
    margin-left: auto;
}

.toolbar-title {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    padding: 4px 8px;
    letter-spacing: 0.3px;
}

.ts-btn {
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #fff;
    transition: all 0.2s;
    white-space: nowrap;
}

.ts-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.30);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.ts-btn:active:not(:disabled) {
    transform: translateY(0);
}

.ts-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.ts-btn-primary {
    background: #66bb6a;
    border-color: #43a047;
    color: #fff;
    font-weight: 600;
}

.ts-btn-primary:hover:not(:disabled) {
    background: #43a047;
    box-shadow: 0 3px 10px rgba(67, 160, 71, 0.45);
}

/* 模式切换 */
.mode-switcher {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    padding: 2px;
    gap: 2px;
}

.mode-btn {
    padding: 5px 12px;
    background: transparent;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.75);
    transition: all 0.2s;
    white-space: nowrap;
}

.mode-btn.active {
    background: rgba(255, 255, 255, 0.9);
    color: #2d7d46;
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.mode-btn:hover:not(.active) {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
}

/* ========== 主内容区：三栏布局 ========== */
.ts-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #f0faf4;
}

/* ========== 左栏：历史记录面板 ========== */
.ts-history-panel {
    width: 200px;
    background: #fff;
    border-right: 1px solid #c8e6c9;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

.history-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: linear-gradient(to bottom, #f1f8e9 0%, #e8f5e9 100%);
    border-bottom: 1px solid #c8e6c9;
    flex-shrink: 0;
}

.history-panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #2e7d32;
}

.history-count {
    font-size: 11px;
    color: #66bb6a;
    font-weight: 400;
    margin-left: 4px;
}

.history-clear-btn {
    background: #ffebee;
    border: none;
    color: #ef5350;
    font-size: 11px;
    cursor: pointer;
    padding: 3px 7px;
    border-radius: 3px;
    transition: all 0.2s;
    white-space: nowrap;
}

.history-clear-btn:hover {
    background: #ffcdd2;
}

.history-search {
    padding: 8px;
    border-bottom: 1px solid #e8f5e9;
    flex-shrink: 0;
}

.history-search input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #c8e6c9;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    color: #333;
}

.history-search input:focus {
    border-color: #43a047;
    box-shadow: 0 0 0 2px rgba(67, 160, 71, 0.12);
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
}

.history-empty {
    text-align: center;
    color: #a5d6a7;
    font-size: 12px;
    margin-top: 24px;
    padding: 0 12px;
}

.history-item {
    padding: 9px 11px;
    margin: 3px 0;
    background: #f9fbe7;
    border: 1px solid #dcedc8;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.18s;
    position: relative;
    animation: tsItemIn 0.2s ease;
}

@keyframes tsItemIn {
    from { opacity: 0; transform: translateX(-8px); }
    to   { opacity: 1; transform: translateX(0); }
}

.history-item:hover {
    background: #f1f8e9;
    border-color: #aed581;
    transform: translateX(2px);
}

.history-item.active {
    background: #e8f5e9;
    border-color: #66bb6a;
    box-shadow: 0 1px 4px rgba(102, 187, 106, 0.25), inset 3px 0 0 #52b788;
}

.history-item-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    background: #ffebee;
    color: #ef5350;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    opacity: 0;
    transition: all 0.2s;
    cursor: pointer;
}

.history-item:hover .history-item-delete {
    opacity: 1;
}

.history-item-delete:hover {
    background: #ef5350;
    color: white;
}

.history-item-text {
    font-size: 12px;
    font-weight: 600;
    color: #2e7d32;
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-item-mode {
    font-size: 10px;
    color: #81c784;
    margin-bottom: 2px;
}

.history-item-time {
    font-size: 10px;
    color: #a5d6a7;
}

/* ========== 中栏：输入面板 ========== */
.ts-input-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-right: 1px solid #c8e6c9;
    overflow: hidden;
    min-width: 280px;
}

.panel-header {
    padding: 14px 18px 10px;
    background: linear-gradient(to bottom, #f9fbe7 0%, #f1f8e9 100%);
    border-bottom: 1px solid #dcedc8;
    flex-shrink: 0;
}

.panel-header h3 {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 600;
    color: #2e7d32;
}

.panel-tip {
    font-size: 12px;
    color: #81c784;
}

/* 结果区 panel-header：h3 与操作区左右并排 */
.ts-result-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ts-result-panel .panel-header h3 {
    margin: 0;
}

/* 结果区操作区（含换一批按钮和 meta 信息） */
.result-panel-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* 结果区操作按钮 */
.ts-result-action-btn {
    padding: 4px 11px;
    background: #e8f5e9;
    border: 1px solid #c8e6c9;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: #2e7d32;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.ts-result-action-btn:hover {
    background: #c8e6c9;
    border-color: #66bb6a;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(67, 160, 71, 0.2);
}

/* 模式说明提示 */
.mode-hint {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 16px;
    background: #f9fbe7;
    border-bottom: 1px solid #f0f4c3;
    font-size: 12px;
    color: #558b2f;
    flex-shrink: 0;
}

.mode-hint-icon {
    flex-shrink: 0;
    font-size: 14px;
}

.ts-input-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* 表单组 */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #2e7d32;
}

.required-mark {
    color: #ef5350;
    margin-left: 2px;
}

.label-tip {
    font-weight: 400;
    color: #a5d6a7;
    font-size: 11px;
}

.ts-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #c8e6c9;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    color: #333;
    background: #fff;
}

.ts-input:focus {
    border-color: #43a047;
    box-shadow: 0 0 0 2px rgba(67, 160, 71, 0.12);
}

.ts-textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #c8e6c9;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.7;
    font-family: inherit;
    resize: vertical;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    color: #333;
    background: #fff;
    min-height: 100px;
}

.ts-textarea:focus {
    border-color: #43a047;
    box-shadow: 0 0 0 2px rgba(67, 160, 71, 0.12);
}

.ts-select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #c8e6c9;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    background: #fff;
    cursor: pointer;
    color: #333;
    transition: all 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2366bb6a' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.ts-select:focus {
    border-color: #43a047;
    box-shadow: 0 0 0 2px rgba(67, 160, 71, 0.12);
}

/* 输入控件禁用态（加载中） */
.ts-input:disabled,
.ts-textarea:disabled {
    background: #f5f9f5;
    color: #a5c8a5;
    cursor: not-allowed;
    opacity: 0.7;
}

.ts-select:disabled {
    background-color: #f5f9f5;
    color: #a5c8a5;
    cursor: not-allowed;
    opacity: 0.7;
}

.char-count {
    text-align: right;
    font-size: 11px;
    color: #a5d6a7;
    margin-top: 4px;
}

/* 垃圾类别参考卡片 */
.category-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.category-card {
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    border: 2px solid transparent;
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.category-recyclable {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-color: #90caf9;
}

.category-recyclable:hover {
    border-color: #42a5f5;
}

.category-hazardous {
    background: linear-gradient(135deg, #fce4ec 0%, #f8bbd9 100%);
    border-color: #f48fb1;
}

.category-hazardous:hover {
    border-color: #ec407a;
}

.category-kitchen {
    background: linear-gradient(135deg, #f1f8e9 0%, #dcedc8 100%);
    border-color: #aed581;
}

.category-kitchen:hover {
    border-color: #8bc34a;
}

.category-dry {
    background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
    border-color: #ffd54f;
}

.category-dry:hover {
    border-color: #ffca28;
}

.category-icon {
    font-size: 22px;
    margin-bottom: 4px;
}

.category-name {
    font-size: 12px;
    font-weight: 600;
    color: #424242;
    margin-bottom: 3px;
}

.category-examples {
    font-size: 10px;
    color: #757575;
    line-height: 1.4;
}

/* 物品快捷标签 */
.item-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.item-tag {
    padding: 4px 10px;
    background: #e8f5e9;
    border: 1px solid #c8e6c9;
    border-radius: 12px;
    font-size: 12px;
    color: #2e7d32;
    cursor: pointer;
    transition: all 0.18s;
    white-space: nowrap;
}

.item-tag:hover {
    background: #c8e6c9;
    border-color: #81c784;
    transform: translateY(-1px);
}

/* 常见问题列表 */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.faq-item {
    padding: 9px 13px;
    background: #f9fbe7;
    border: 1px solid #dcedc8;
    border-radius: 6px;
    font-size: 12px;
    color: #33691e;
    cursor: pointer;
    transition: all 0.18s;
}

.faq-item:hover {
    background: #f1f8e9;
    border-color: #aed581;
    padding-left: 18px;
}

/* ========== 右栏：结果面板 ========== */
.ts-result-panel {
    width: 42%;
    display: flex;
    flex-direction: column;
    background: #fff;
    overflow: hidden;
    min-width: 280px;
}

.result-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-meta-tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.result-time {
    font-size: 11px;
    color: #a5d6a7;
}

.ts-result-body {
    flex: 1;
    overflow-y: auto;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* 初始占位 */
.result-placeholder {
    flex: 1;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 30px;
    text-align: center;
}

.recycle-animation {
    margin-bottom: 20px;
}

.recycle-icon {
    font-size: 64px;
    animation: tsRotate 6s linear infinite;
    display: inline-block;
}

@keyframes tsRotate {
    0%   { transform: rotate(0deg) scale(1); }
    50%  { transform: rotate(180deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
}

.placeholder-title {
    font-size: 16px;
    font-weight: 600;
    color: #2e7d32;
    margin: 0 0 8px;
}

.placeholder-desc {
    font-size: 13px;
    color: #a5d6a7;
    margin: 3px 0;
}

/* 加载中 */
.result-loading {
    flex: 1;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.ts-loading-anim {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.ts-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #66bb6a;
    animation: tsDotBounce 1.2s ease-in-out infinite;
}

.ts-dot:nth-child(2) { animation-delay: 0.2s; }
.ts-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes tsDotBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40%           { transform: scale(1.0); opacity: 1.0; }
}

.loading-text {
    font-size: 14px;
    color: #66bb6a;
    font-weight: 500;
}

/* 结果内容 */
.ts-result-content {
    padding: 16px;
    animation: tsContentIn 0.3s ease;
}

/* 错误状态 */
.ts-result-error {
    flex: 1;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 30px;
    text-align: center;
}

.ts-result-error-icon {
    font-size: 36px;
    margin-bottom: 12px;
    opacity: 0.85;
}

.ts-result-error-msg {
    font-size: 14px;
    color: #ef5350;
    line-height: 1.6;
    max-width: 260px;
}

/* 错误状态重试按钮 */
.ts-error-retry-btn {
    margin-top: 14px;
    padding: 6px 18px;
    background: #fff3e0;
    border: 1px solid #ffcc80;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: #e65100;
    cursor: pointer;
    transition: all 0.2s;
}

.ts-error-retry-btn:hover {
    background: #ffe0b2;
    border-color: #ffa726;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(230, 81, 0, 0.2);
}

@keyframes tsContentIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* 结果卡片 */
.ts-result-card {
    background: #f9fbe7;
    border: 1px solid #c8e6c9;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
    position: relative;
}

.ts-result-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #c8e6c9;
}

.ts-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.ts-category-badge.recyclable {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    color: #1565c0;
    border: 1px solid #90caf9;
}

.ts-category-badge.hazardous {
    background: linear-gradient(135deg, #fce4ec, #f8bbd9);
    color: #880e4f;
    border: 1px solid #f48fb1;
}

.ts-category-badge.kitchen {
    background: linear-gradient(135deg, #f1f8e9, #dcedc8);
    color: #1b5e20;
    border: 1px solid #aed581;
}

.ts-category-badge.dry {
    background: linear-gradient(135deg, #fff8e1, #ffecb3);
    color: #e65100;
    border: 1px solid #ffd54f;
}

.ts-result-section {
    margin-bottom: 10px;
}

.ts-result-section-title {
    font-size: 12px;
    font-weight: 600;
    color: #558b2f;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ts-result-section-body {
    font-size: 13px;
    color: #424242;
    line-height: 1.7;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 6px;
    border-left: 3px solid #a5d6a7;
}

/* 结果卡片物品标签 */
.ts-result-item-label {
    font-size: 12px;
    color: #81c784;
}

/* QA结果 */
.ts-qa-result {
    font-size: 14px;
    line-height: 1.8;
    color: #333;
    padding: 16px;
    background: #f9fbe7;
    border: 1px solid #c8e6c9;
    border-radius: 10px;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ========== 模态框 ========== */
.ts-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 100000;
    backdrop-filter: blur(2px);
}

.ts-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100001;
    width: min(600px, 90vw);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.ts-modal-content {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 80vh;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.16);
    animation: tsModalIn 0.22s ease-out;
}

@keyframes tsModalIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

.ts-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: linear-gradient(135deg, #2d7d46 0%, #1b5e20 100%);
    color: #fff;
    flex-shrink: 0;
}

.ts-modal-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.ts-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ts-modal-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

.ts-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* 示例卡片 */
.example-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
}

.example-card {
    padding: 14px;
    background: #f9fbe7;
    border: 1px solid #c8e6c9;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.18s;
}

.example-card:hover {
    background: #f1f8e9;
    border-color: #66bb6a;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(102, 187, 106, 0.2);
}

.example-card-mode {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 8px;
    display: inline-block;
    margin-bottom: 7px;
}

.example-card-mode.classify {
    background: #e8f5e9;
    color: #2e7d32;
}

.example-card-mode.qa {
    background: #e3f2fd;
    color: #1565c0;
}

.example-card-title {
    font-size: 13px;
    font-weight: 600;
    color: #2e7d32;
    margin-bottom: 4px;
}

.example-card-desc {
    font-size: 12px;
    color: #757575;
    line-height: 1.5;
}

/* 类别详情 */
.category-detail-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: 8px;
    margin-bottom: 14px;
}

/* 类别详情头部背景（仍匹配了不同类别） */
.category-detail-header--recyclable { background: #e3f2fd; }
.category-detail-header--hazardous  { background: #fce4ec; }
.category-detail-header--kitchen    { background: #f1f8e9; }
.category-detail-header--dry        { background: #fff8e1; }

/* 类别详情副标题 */
.category-detail-subtitle {
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 600;
    color: #424242;
}

.category-detail-icon {
    font-size: 36px;
}

.category-detail-name {
    font-size: 18px;
    font-weight: 700;
    color: #424242;
}

.category-detail-desc {
    font-size: 13px;
    color: #757575;
    margin-top: 3px;
}

.category-detail-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 8px;
}

.category-detail-item {
    padding: 4px 12px;
    background: #fff;
    border-radius: 12px;
    font-size: 12px;
    color: #424242;
    border: 1px solid #e0e0e0;
}

.category-detail-tips {
    margin-top: 14px;
    padding: 12px 14px;
    background: #f9fbe7;
    border-radius: 8px;
    border-left: 3px solid #66bb6a;
}

.category-detail-tips-title {
    font-size: 13px;
    font-weight: 600;
    color: #2e7d32;
    margin-bottom: 8px;
}

.category-detail-tips ul {
    margin: 0;
    padding-left: 18px;
    font-size: 12px;
    color: #558b2f;
    line-height: 1.8;
}

/* ========== 滚动条样式 ========== */
.ts-result-body::-webkit-scrollbar,
.ts-input-body::-webkit-scrollbar,
.history-list::-webkit-scrollbar,
.ts-modal-body::-webkit-scrollbar {
    width: 4px;
}

.ts-result-body::-webkit-scrollbar-track,
.ts-input-body::-webkit-scrollbar-track,
.history-list::-webkit-scrollbar-track,
.ts-modal-body::-webkit-scrollbar-track {
    background: #f1f8e9;
}

.ts-result-body::-webkit-scrollbar-thumb,
.ts-input-body::-webkit-scrollbar-thumb,
.history-list::-webkit-scrollbar-thumb,
.ts-modal-body::-webkit-scrollbar-thumb {
    background: #a5d6a7;
    border-radius: 2px;
}

.ts-result-body::-webkit-scrollbar-thumb:hover,
.ts-input-body::-webkit-scrollbar-thumb:hover,
.history-list::-webkit-scrollbar-thumb:hover,
.ts-modal-body::-webkit-scrollbar-thumb:hover {
    background: #66bb6a;
}

/* ========== 响应式布局 ========== */
@media (max-width: 900px) {
    .ts-main-content {
        flex-direction: column;
    }

    .ts-history-panel {
        width: 100%;
        height: 140px;
        border-right: none;
        border-bottom: 1px solid #c8e6c9;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .history-panel-header {
        width: 100%;
    }

    .history-list {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 6px;
        gap: 6px;
    }

    .history-item {
        min-width: 130px;
        margin: 0;
    }

    .ts-result-panel {
        width: 100%;
        min-width: unset;
        height: 350px;
    }

    .ts-input-panel {
        min-width: unset;
    }

    .ts-container {
        height: auto;
        min-height: calc(100vh - 180px);
    }
}

@media (max-width: 600px) {
    .ts-toolbar {
        padding: 6px 8px;
        gap: 4px;
    }

    .toolbar-title {
        display: none;
    }

    .ts-btn {
        padding: 5px 7px;
        font-size: 11px;
    }

    .category-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========== 暗黑模式 ========== */
body.dark .ts-container {
    background: #1a2e1a;
}

body.dark .ts-toolbar {
    background: linear-gradient(135deg, #1b3a21 0%, #0d2210 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

body.dark .ts-btn {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #c8e6c9;
}

body.dark .ts-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.18);
}

body.dark .ts-btn-primary {
    background: #388e3c;
    border-color: #2e7d32;
    color: #fff;
}

body.dark .ts-btn-primary:hover:not(:disabled) {
    background: #2e7d32;
}

body.dark .mode-switcher {
    background: rgba(0, 0, 0, 0.35);
}

body.dark .mode-btn {
    color: rgba(200, 230, 201, 0.7);
}

body.dark .mode-btn.active {
    background: rgba(200, 230, 201, 0.9);
    color: #1b5e20;
}

body.dark .ts-main-content {
    background: #1a2e1a;
}

body.dark .ts-history-panel {
    background: #0d1e0d;
    border-color: #2e4a2e;
}

body.dark .history-panel-header {
    background: linear-gradient(to bottom, #1a2e1a, #143214);
    border-color: #2e4a2e;
}

body.dark .history-panel-header h3 {
    color: #a5d6a7;
}

body.dark .history-search input {
    background: #0d1e0d;
    border-color: #2e4a2e;
    color: #c8e6c9;
}

body.dark .history-search input::placeholder {
    color: #4a6e4a;
}

body.dark .history-search input:focus {
    border-color: #66bb6a;
}

body.dark .history-list {
    background: #0d1e0d;
}

body.dark .history-empty {
    color: #4a6e4a;
}

body.dark .history-item {
    background: #1a2e1a;
    border-color: #2e4a2e;
}

body.dark .history-item:hover {
    background: #1e381e;
    border-color: #4a7a4a;
}

body.dark .history-item.active {
    background: #1e3a1e;
    border-color: #66bb6a;
    box-shadow: 0 1px 4px rgba(102, 187, 106, 0.2), inset 3px 0 0 #43a047;
}

body.dark .history-item-text {
    color: #a5d6a7;
}

body.dark .history-item-time {
    color: #4a6e4a;
}

body.dark .ts-input-panel {
    background: #0d1e0d;
    border-color: #2e4a2e;
}

body.dark .panel-header {
    background: linear-gradient(to bottom, #1a2e1a, #143214);
    border-color: #2e4a2e;
}

body.dark .panel-header h3 {
    color: #a5d6a7;
}

body.dark .panel-tip {
    color: #4a7a4a;
}

body.dark .mode-hint {
    background: #142014;
    border-color: #1e3a1e;
    color: #81c784;
}

body.dark .ts-input-body {
    background: #0d1e0d;
}

body.dark .form-group label {
    color: #a5d6a7;
}

body.dark .ts-input,
body.dark .ts-textarea,
body.dark .ts-select {
    background: #1a2e1a;
    border-color: #2e4a2e;
    color: #c8e6c9;
}

/* 输入控件禁用态 暗黑 */
body.dark .ts-input:disabled,
body.dark .ts-textarea:disabled,
body.dark .ts-select:disabled {
    background: #0d1a0d;
    color: #4a6e4a;
    opacity: 0.7;
}

body.dark .ts-input::placeholder,
body.dark .ts-textarea::placeholder {
    color: #4a6e4a;
}

body.dark .ts-input:focus,
body.dark .ts-textarea:focus,
body.dark .ts-select:focus {
    border-color: #66bb6a;
}

body.dark .char-count {
    color: #4a6e4a;
}

/* 类别卡片 - 暗黑模式用具体颜色替代 filter */
body.dark .category-recyclable { background: linear-gradient(135deg, #1a2535 0%, #1a304a 100%); border-color: #2a4a6a; }
body.dark .category-hazardous  { background: linear-gradient(135deg, #2e1522 0%, #3a1a2a 100%); border-color: #5a2045; }
body.dark .category-kitchen    { background: linear-gradient(135deg, #182a18 0%, #1e361e 100%); border-color: #2e502e; }
body.dark .category-dry        { background: linear-gradient(135deg, #2a2012 0%, #352815 100%); border-color: #5a4520; }
body.dark .category-card .category-name     { color: #e0e0e0; }
body.dark .category-card .category-examples { color: #9e9e9e; }

body.dark .category-card:hover {
    opacity: 0.9;
}

body.dark .item-tag {
    background: #1a2e1a;
    border-color: #2e4a2e;
    color: #81c784;
}

body.dark .item-tag:hover {
    background: #1e381e;
    border-color: #66bb6a;
}

body.dark .faq-item {
    background: #142014;
    border-color: #1e3a1e;
    color: #81c784;
}

body.dark .faq-item:hover {
    background: #1a2e1a;
    border-color: #4a7a4a;
}

body.dark .ts-result-panel {
    background: #0d1e0d;
}

body.dark .ts-result-panel .panel-header {
    background: linear-gradient(to bottom, #1a2e1a, #143214);
    border-color: #2e4a2e;
}

body.dark .ts-result-panel .panel-header h3 {
    color: #a5d6a7;
}

body.dark .result-placeholder .placeholder-title {
    color: #a5d6a7;
}

body.dark .result-placeholder .placeholder-desc {
    color: #4a7a4a;
}

body.dark .ts-result-error-msg {
    color: #ef9a9a;
}

body.dark .ts-error-retry-btn {
    background: #2a1a05;
    border-color: #5a3a10;
    color: #ffb74d;
}

body.dark .ts-error-retry-btn:hover {
    background: #3a2510;
    border-color: #7a5010;
}

body.dark .ts-result-content {
    background: #0d1e0d;
}

/* 结果区操作按钮 暗黑 */
body.dark .ts-result-action-btn {
    background: #1a2e1a;
    border-color: #2e4a2e;
    color: #81c784;
}
body.dark .ts-result-action-btn:hover {
    background: #1e381e;
    border-color: #4a7a4a;
}

body.dark .ts-result-card {
    background: #142014;
    border-color: #2e4a2e;
}

body.dark .ts-result-card-header {
    border-color: #2e4a2e;
}

body.dark .ts-result-section-title {
    color: #81c784;
}

body.dark .ts-result-section-body {
    background: rgba(255, 255, 255, 0.05);
    color: #c8e6c9;
    border-color: #4a7a4a;
}

/* 结果卡片物品标签 暗黑 */
body.dark .ts-result-item-label {
    color: #66bb6a;
}

body.dark .ts-qa-result {
    background: #142014;
    border-color: #2e4a2e;
    color: #c8e6c9;
}

body.dark .ts-modal-content {
    background: #0d1e0d;
}

body.dark .ts-modal-body {
    background: #0d1e0d;
}

body.dark .example-card {
    background: #1a2e1a;
    border-color: #2e4a2e;
}

body.dark .example-card:hover {
    background: #1e381e;
    border-color: #66bb6a;
}

body.dark .example-card-title {
    color: #a5d6a7;
}

body.dark .example-card-desc {
    color: #4a7a4a;
}

/* 类别详情头部 暗黑 */
body.dark .category-detail-header--recyclable { background: #1a2535; }
body.dark .category-detail-header--hazardous  { background: #2e1522; }
body.dark .category-detail-header--kitchen    { background: #182a18; }
body.dark .category-detail-header--dry        { background: #2a2012; }
body.dark .category-detail-subtitle           { color: #c8e6c9; }

body.dark .ts-result-body::-webkit-scrollbar-track,
body.dark .ts-input-body::-webkit-scrollbar-track,
body.dark .history-list::-webkit-scrollbar-track,
body.dark .ts-modal-body::-webkit-scrollbar-track {
    background: #0d1e0d;
}

body.dark .ts-result-body::-webkit-scrollbar-thumb,
body.dark .ts-input-body::-webkit-scrollbar-thumb,
body.dark .history-list::-webkit-scrollbar-thumb,
body.dark .ts-modal-body::-webkit-scrollbar-thumb {
    background: #2e4a2e;
}

body.dark .ts-result-body::-webkit-scrollbar-thumb:hover,
body.dark .ts-input-body::-webkit-scrollbar-thumb:hover,
body.dark .history-list::-webkit-scrollbar-thumb:hover,
body.dark .ts-modal-body::-webkit-scrollbar-thumb:hover {
    background: #4a7a4a;
}

/* ========== 打印样式 ========== */
@media print {
    .ts-toolbar,
    .ts-history-panel,
    .ts-input-panel {
        display: none !important;
    }

    .ts-result-panel {
        width: 100% !important;
    }

    .ts-container {
        height: auto !important;
        box-shadow: none;
    }
}
