/* ========== 词语造句工具 - 主容器 ========== */
.sc-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: #f5f7fa;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

/* 全屏模式 */
.sc-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
}

/* ========== 顶部工具栏 ========== */
.sc-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(17, 153, 142, 0.3);
    flex-shrink: 0;
}

.toolbar-title {
    font-size: 14px;
    font-weight: 600;
    color: white;
    margin-right: 4px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.toolbar-group {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    min-height: 28px;
}

.toolbar-btn {
    padding: 5px 11px;
    background: rgba(255, 255, 255, 0.92);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #0d8c7a;
    transition: all 0.25s;
    white-space: nowrap;
}

.toolbar-btn:hover:not(:disabled) {
    background: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.toolbar-btn:active:not(:disabled) {
    transform: translateY(0);
}

.toolbar-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.toolbar-btn-primary {
    background: #fff;
    color: #0a7b6a;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.toolbar-btn-primary:hover:not(:disabled) {
    background: #f0fdf9;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

/* ========== 主内容区 ========== */
.sc-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #f5f7fa;
}

/* ========== 左栏：历史记录 ========== */
.sc-history-panel {
    width: 210px;
    background: white;
    border-right: 1px solid #e8edf3;
    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, #fafbfc 0%, #f4f6f8 100%);
    border-bottom: 1px solid #e8edf3;
    flex-shrink: 0;
}

.history-panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #4a6070;
}

.history-count {
    font-size: 11px;
    color: #94a3b8;
    margin-left: 4px;
}

.history-clear-btn {
    background: #fff0f0;
    border: none;
    color: #ef4444;
    font-size: 11px;
    cursor: pointer;
    padding: 3px 7px;
    border-radius: 4px;
    transition: all 0.2s;
    white-space: nowrap;
}

.history-clear-btn:hover {
    background: #fde8e8;
}

.history-search {
    padding: 8px;
    border-bottom: 1px solid #e8edf3;
    flex-shrink: 0;
}

.history-search input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #dde3ec;
    border-radius: 5px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    background: #fafbfc;
}

.history-search input:focus {
    border-color: #11998e;
    box-shadow: 0 0 0 2px rgba(17, 153, 142, 0.1);
    background: #fff;
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.history-list::-webkit-scrollbar {
    width: 4px;
}

.history-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

.history-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.history-empty {
    text-align: center;
    color: #94a3b8;
    font-size: 12px;
    padding: 24px 0;
}

.history-item {
    padding: 10px 12px;
    margin-bottom: 6px;
    background: #f8fafc;
    border: 1px solid #e8edf3;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    animation: fadeInSlide 0.2s ease;
}

.history-item:hover {
    background: #f0fdf9;
    border-color: #a7f3d0;
    transform: translateX(2px);
}

.history-item.active {
    background: #ecfdf5;
    border-color: #11998e;
    box-shadow: inset 3px 0 0 #3b82f6, 0 1px 4px rgba(17, 153, 142, 0.15);
}

.history-item-word {
    font-size: 13px;
    font-weight: 600;
    color: #1e3a5f;
    margin-bottom: 3px;
}

.history-item-meta {
    font-size: 11px;
    color: #94a3b8;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.history-item-delete {
    position: absolute;
    top: 5px;
    right: 6px;
    width: 18px;
    height: 18px;
    background: #fde8e8;
    color: #ef4444;
    border: none;
    border-radius: 4px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
}

.history-item:hover .history-item-delete {
    display: flex;
}

.history-item-delete:hover {
    background: #fca5a5;
}

@keyframes fadeInSlide {
    from { opacity: 0; transform: translateX(-8px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ========== 中栏：表单输入 ========== */
.sc-input-panel {
    width: 320px;
    flex-shrink: 0;
    background: white;
    border-right: 1px solid #e8edf3;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    padding: 12px 16px;
    border-bottom: 1px solid #e8edf3;
    background: linear-gradient(to bottom, #fafbfc 0%, #f4f6f8 100%);
    flex-shrink: 0;
}

.panel-header h3 {
    margin: 0 0 3px 0;
    font-size: 14px;
    font-weight: 600;
    color: #1e3a5f;
}

.panel-tip {
    font-size: 11px;
    color: #94a3b8;
}

.sc-input-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
}

.sc-input-body::-webkit-scrollbar {
    width: 4px;
}

.sc-input-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

.sc-input-body::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #4a6070;
    margin-bottom: 6px;
}

.required-mark {
    color: #ef4444;
    margin-left: 2px;
}

.label-tip {
    font-weight: 400;
    color: #94a3b8;
}

/* 词语输入框特殊样式 */
.word-input-group {
    background: linear-gradient(135deg, #f0fdf9 0%, #ecfdf5 100%);
    border: 1.5px solid #a7f3d0;
    border-radius: 10px;
    padding: 12px;
}

.word-input-group label {
    color: #0a7b6a;
    font-size: 13px;
}

.word-input-wrapper {
    position: relative;
}

.sc-word-input {
    width: 100%;
    padding: 10px 44px 10px 14px;
    border: 1.5px solid #6ee7b7;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    color: #065f46;
    background: white;
    outline: none;
    transition: all 0.25s;
    box-sizing: border-box;
    letter-spacing: 2px;
}

.sc-word-input:focus {
    border-color: #11998e;
    box-shadow: 0 0 0 3px rgba(17, 153, 142, 0.12);
}

.sc-word-input::placeholder {
    color: #a7f3d0;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0;
}

.word-char-limit {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    color: #a7f3d0;
    pointer-events: none;
    transition: color 0.2s;
}

.word-char-limit.warn {
    color: #f59e0b;
}

.sc-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dde3ec;
    border-radius: 6px;
    font-size: 13px;
    color: #2d3748;
    background: #fafbfc;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
}

.sc-input:focus {
    border-color: #11998e;
    box-shadow: 0 0 0 2px rgba(17, 153, 142, 0.1);
    background: #fff;
}

.sc-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dde3ec;
    border-radius: 6px;
    font-size: 13px;
    color: #2d3748;
    background: #fafbfc;
    outline: none;
    cursor: pointer;
    transition: all 0.2s;
    box-sizing: border-box;
    appearance: auto;
}

.sc-select:focus {
    border-color: #11998e;
    box-shadow: 0 0 0 2px rgba(17, 153, 142, 0.1);
    background: #fff;
}

/* 例句数量选择器 */
.count-selector {
    display: flex;
    gap: 8px;
}

.count-btn {
    flex: 1;
    padding: 7px 0;
    border: 1.5px solid #dde3ec;
    border-radius: 6px;
    background: #fafbfc;
    color: #4a6070;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.count-btn:hover {
    border-color: #11998e;
    color: #11998e;
    background: #f0fdf9;
}

.count-btn.active {
    border-color: #11998e;
    background: linear-gradient(135deg, #11998e, #38ef7d);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(17, 153, 142, 0.3);
}

.sc-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dde3ec;
    border-radius: 6px;
    font-size: 13px;
    color: #2d3748;
    background: #fafbfc;
    outline: none;
    resize: vertical;
    transition: all 0.2s;
    box-sizing: border-box;
    font-family: inherit;
    min-height: 70px;
}

.sc-textarea:focus {
    border-color: #11998e;
    box-shadow: 0 0 0 2px rgba(17, 153, 142, 0.1);
    background: #fff;
}

/* ========== 右栏：结果展示 ========== */
.sc-result-panel {
    flex: 1;
    background: white;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* 右栏面板头：标题与结果元信息并排 */
.sc-result-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 16px;
}

.sc-result-panel .panel-header h3 {
    margin: 0;
    white-space: nowrap;
}

.result-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.result-meta-word {
    display: inline-block;
    padding: 2px 10px;
    background: linear-gradient(135deg, #11998e, #38ef7d);
    color: white;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.result-count-info, .result-time {
    font-size: 11px;
    color: #94a3b8;
}

.sc-result-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    position: relative;
    display: flex;
    flex-direction: column;
}

.sc-result-body::-webkit-scrollbar {
    width: 5px;
}

.sc-result-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.sc-result-body::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 占位状态 */
.result-placeholder {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: #94a3b8;
    text-align: center;
}

.placeholder-icon {
    font-size: 56px;
    margin-bottom: 16px;
    opacity: 0.6;
    animation: gentleFloat 3s ease-in-out infinite;
}

@keyframes gentleFloat {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-8px); }
}

.placeholder-title {
    font-size: 16px;
    font-weight: 600;
    color: #4a6070;
    margin: 0 0 8px 0;
}

.placeholder-desc {
    font-size: 13px;
    color: #94a3b8;
    margin: 0 0 4px 0;
}

.placeholder-tips {
    display: flex;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.tip-tag {
    padding: 4px 12px;
    background: #f0fdf9;
    border: 1px solid #a7f3d0;
    border-radius: 20px;
    font-size: 12px;
    color: #0a7b6a;
}

/* 加载状态 */
.result-loading {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

/* 铅笔动画 */
.loading-pencil {
    position: relative;
    width: 60px;
    height: 60px;
    margin-bottom: 20px;
}

.pencil-body {
    width: 12px;
    height: 40px;
    background: linear-gradient(135deg, #11998e, #38ef7d);
    border-radius: 2px 2px 0 0;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    animation: pencilWrite 1.2s ease-in-out infinite;
}

.pencil-tip {
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 10px solid #0d8c7a;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 40px;
    animation: pencilWrite 1.2s ease-in-out infinite;
}

.writing-line {
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #11998e, transparent);
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    animation: writingExpand 1.2s ease-in-out infinite;
    border-radius: 1px;
}

@keyframes pencilWrite {
    0%, 100% { transform: translateX(-50%) rotate(-5deg); }
    50%       { transform: translateX(-50%) rotate(5deg); }
}

@keyframes writingExpand {
    0%   { width: 0; opacity: 1; }
    60%  { width: 50px; opacity: 1; }
    100% { width: 50px; opacity: 0; }
}

.loading-text {
    font-size: 14px;
    color: #4a6070;
    margin: 0 0 6px 0;
    font-weight: 500;
}

.loading-carousel-msg {
    font-size: 12px;
    color: #94a3b8;
    margin: 0 0 12px 0;
    min-height: 18px;
}

.loading-dots {
    display: flex;
    gap: 6px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: #11998e;
    border-radius: 50%;
    animation: dotBounce 1.2s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBounce {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40%           { transform: scale(1.2); opacity: 1; }
}

/* 错误状态 */
.result-error {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    text-align: center;
    padding: 24px;
}

.result-error-icon {
    font-size: 48px;
    margin-bottom: 14px;
    opacity: 0.8;
}

.result-error-msg {
    font-size: 14px;
    color: #64748b;
    margin: 0 0 20px 0;
    line-height: 1.6;
}

.error-retry-btn {
    padding: 9px 24px;
    background: linear-gradient(135deg, #11998e, #38ef7d);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    box-shadow: 0 2px 8px rgba(17, 153, 142, 0.3);
}

.error-retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 16px rgba(17, 153, 142, 0.4);
}

.error-retry-btn:active {
    transform: translateY(0);
}

/* 结果内容 */
.result-content {
    font-size: 14px;
    line-height: 1.8;
    color: #2d3748;
    animation: fadeIn 0.4s ease;
    padding-bottom: 20px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.result-content h2 {
    font-size: 15px;
    font-weight: 700;
    color: #0a7b6a;
    margin: 18px 0 10px 0;
    padding-bottom: 6px;
    border-bottom: 2px solid #a7f3d0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.result-content h2:first-child {
    margin-top: 0;
}

.result-content p {
    margin: 8px 0;
    color: #3d5166;
}

.result-content strong {
    color: #065f46;
    font-weight: 600;
}

.result-content em {
    font-style: italic;
    color: #059669;
}

.result-content h3 {
    font-size: 13px;
    font-weight: 600;
    color: #047857;
    margin: 12px 0 6px 0;
    padding-left: 8px;
    border-left: 2px solid #a7f3d0;
}

.result-content pre {
    background: #f0fdf9;
    border: 1px solid #a7f3d0;
    border-radius: 6px;
    padding: 10px 14px;
    overflow-x: auto;
    margin: 8px 0;
    font-size: 12px;
}

.result-content code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    color: #047857;
    background: #f0fdf9;
    padding: 1px 5px;
    border-radius: 3px;
}

.result-content blockquote {
    margin: 4px 0 10px 0;
    padding: 6px 12px;
    background: #f0fdf9;
    border-left: 3px solid #11998e;
    border-radius: 0 6px 6px 0;
    font-size: 12px;
    color: #047857;
}

.result-content ul, .result-content ol {
    margin: 8px 0;
    padding-left: 20px;
}

.result-content li {
    margin-bottom: 4px;
    color: #3d5166;
}

.result-content hr {
    border: none;
    border-top: 1px dashed #d1fae5;
    margin: 16px 0;
}

/* ========== 示例模态框 ========== */
.sc-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 10000;
    backdrop-filter: blur(2px);
}

.sc-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10001;
    width: 680px;
    max-width: 96vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.sc-modal-content {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    max-height: 85vh;
}

.sc-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    flex-shrink: 0;
}

.sc-modal-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.sc-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.sc-modal-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

.sc-modal-body {
    padding: 16px 20px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.sc-modal-body::-webkit-scrollbar {
    width: 5px;
}

.sc-modal-body::-webkit-scrollbar-track {
    background: #f5f7fa;
    border-radius: 3px;
}

.sc-modal-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.example-card {
    padding: 14px 16px;
    background: #fafbfc;
    border: 1.5px solid #e8edf3;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.example-card:hover {
    border-color: #11998e;
    background: #f0fdf9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(17, 153, 142, 0.12);
}

.example-card-word {
    font-size: 18px;
    font-weight: 700;
    color: #0a7b6a;
    margin-bottom: 4px;
    letter-spacing: 2px;
}

.example-card-desc {
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
    margin-bottom: 8px;
}

.example-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.example-tag {
    padding: 2px 8px;
    background: #e8f5f3;
    color: #0a7b6a;
    border-radius: 10px;
    font-size: 11px;
}

/* ========== Toast 提示 ========== */
.sc-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(17, 153, 142, 0.92);
    color: white;
    padding: 10px 20px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    z-index: 99999;
    opacity: 0;
    transition: all 0.3s ease;
    white-space: nowrap;
    backdrop-filter: blur(4px);
}

.sc-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.sc-toast.error {
    background: rgba(239, 68, 68, 0.9);
}

/* ========== 暗黑模式 ========== */
body.dark .sc-container {
    background: #1a2233;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

body.dark .sc-toolbar {
    background: linear-gradient(135deg, #0d7a72 0%, #1fa86b 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

body.dark .toolbar-btn {
    background: rgba(255, 255, 255, 0.12);
    color: #a7f3d0;
}

body.dark .toolbar-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.22);
}

body.dark .toolbar-btn-primary {
    background: rgba(255, 255, 255, 0.18);
    color: #ecfdf5;
}

body.dark .sc-main-content {
    background: #1a2233;
}

/* 左栏暗黑 */
body.dark .sc-history-panel {
    background: #1e2d3d;
    border-right-color: #2d4059;
}

body.dark .history-panel-header {
    background: linear-gradient(to bottom, #1e2d3d 0%, #1a2633 100%);
    border-bottom-color: #2d4059;
}

body.dark .history-panel-header h3 {
    color: #9ecfbf;
}

body.dark .history-search input {
    background: #16222e;
    border-color: #2d4059;
    color: #c8d8e4;
}

body.dark .history-search input:focus {
    border-color: #11998e;
    box-shadow: 0 0 0 2px rgba(17, 153, 142, 0.2);
    background: #1a2a38;
}

body.dark .history-search input::placeholder {
    color: #4a6070;
}

body.dark .history-list {
    background: #1e2d3d;
}

body.dark .history-list::-webkit-scrollbar-thumb {
    background: #2d4059;
}

body.dark .history-list::-webkit-scrollbar-track {
    background: #1e2d3d;
}

body.dark .history-list::-webkit-scrollbar-thumb:hover {
    background: #3d5570;
}

body.dark .history-empty {
    color: #4a6070;
}

body.dark .history-item {
    background: #16222e;
    border-color: #2d4059;
}

body.dark .history-item:hover {
    background: #1a3040;
    border-color: #11998e;
}

body.dark .history-item.active {
    background: #0d2a28;
    border-color: #11998e;
    box-shadow: inset 3px 0 0 #3b82f6;
}

body.dark .history-item-word {
    color: #9ecfbf;
}

body.dark .history-item-meta {
    color: #4a6070;
}

/* 中栏暗黑 */
body.dark .sc-input-panel {
    background: #1e2d3d;
    border-right-color: #2d4059;
}

body.dark .panel-header {
    background: linear-gradient(to bottom, #1e2d3d 0%, #1a2633 100%);
    border-bottom-color: #2d4059;
}

body.dark .panel-header h3 {
    color: #9ecfbf;
}

body.dark .panel-tip {
    color: #4a6070;
}

body.dark .sc-input-body::-webkit-scrollbar-thumb {
    background: #2d4059;
}

body.dark .sc-input-body::-webkit-scrollbar-track {
    background: #1e2d3d;
}

body.dark .sc-input-body::-webkit-scrollbar-thumb:hover {
    background: #3d5570;
}

body.dark .form-group label {
    color: #7fa8a0;
}

body.dark .word-input-group {
    background: linear-gradient(135deg, #0d2a28 0%, #0a2420 100%);
    border-color: #11998e;
}

body.dark .word-input-group label {
    color: #6ee7b7;
}

body.dark .sc-word-input {
    background: #16222e;
    border-color: #11998e;
    color: #a7f3d0;
}

body.dark .sc-word-input:focus {
    box-shadow: 0 0 0 3px rgba(17, 153, 142, 0.25);
}

body.dark .sc-word-input::placeholder {
    color: #1e4a42;
}

body.dark .word-char-limit {
    color: #1e4a42;
}

body.dark .word-char-limit.warn {
    color: #d97706;
}

body.dark .sc-input,
body.dark .sc-select,
body.dark .sc-textarea {
    background: #16222e;
    border-color: #2d4059;
    color: #c8d8e4;
    color-scheme: dark;
}

body.dark .sc-input:focus,
body.dark .sc-select:focus,
body.dark .sc-textarea:focus {
    border-color: #11998e;
    box-shadow: 0 0 0 2px rgba(17, 153, 142, 0.2);
    background: #1a2a38;
}

body.dark .count-btn {
    background: #16222e;
    border-color: #2d4059;
    color: #7a9ab0;
}

body.dark .count-btn:hover {
    border-color: #11998e;
    color: #6ee7b7;
    background: #0d2a28;
}

body.dark .count-btn.active {
    border-color: #11998e;
    background: linear-gradient(135deg, #0d7a72, #1fa86b);
    color: white;
}

/* 右栏暗黑 */
body.dark .sc-result-panel {
    background: #1e2d3d;
}

body.dark .sc-result-body {
    background: #1e2d3d;
}

body.dark .sc-result-body::-webkit-scrollbar-thumb {
    background: #2d4059;
}

body.dark .sc-result-body::-webkit-scrollbar-track {
    background: #1e2d3d;
}

body.dark .sc-result-body::-webkit-scrollbar-thumb:hover {
    background: #3d5570;
}

body.dark .placeholder-icon {
    filter: brightness(0.8);
}

body.dark .placeholder-title {
    color: #7fa8a0;
}

body.dark .placeholder-desc {
    color: #4a6070;
}

body.dark .tip-tag {
    background: #0d2a28;
    border-color: #11998e;
    color: #6ee7b7;
}

body.dark .loading-text {
    color: #7fa8a0;
}

body.dark .loading-carousel-msg {
    color: #4a6070;
}

body.dark .result-content {
    color: #c8d8e4;
}

body.dark .result-content h2 {
    color: #6ee7b7;
    border-bottom-color: #11998e;
}

body.dark .result-content p {
    color: #9eb8c8;
}

body.dark .result-content strong {
    color: #a7f3d0;
}

body.dark .result-content em {
    color: #34d399;
}

body.dark .result-content h3 {
    color: #34d399;
    border-left-color: #11998e;
}

body.dark .result-content pre {
    background: #0d2a28;
    border-color: #11998e;
    color: #a7f3d0;
}

body.dark .result-content code {
    background: #0d2a28;
    color: #6ee7b7;
}

body.dark .result-content blockquote {
    background: #0d2a28;
    border-left-color: #11998e;
    color: #6ee7b7;
}

body.dark .result-content li {
    color: #9eb8c8;
}

body.dark .result-content hr {
    border-top-color: #1e3a2e;
}

/* 错误状态暗黑 */
body.dark .result-error-msg {
    color: #7fa8a0;
}

body.dark .error-retry-btn {
    background: linear-gradient(135deg, #0d7a72, #1fa86b);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark .error-retry-btn:hover {
    box-shadow: 0 5px 16px rgba(0, 0, 0, 0.4);
}

/* 示例模态框暗黑 */
body.dark .sc-modal-content {
    background: #1e2d3d;
}

body.dark .sc-modal-header {
    background: linear-gradient(135deg, #0d7a72 0%, #1fa86b 100%);
}

body.dark .sc-modal-body::-webkit-scrollbar-track {
    background: #1a2233;
}

body.dark .sc-modal-body::-webkit-scrollbar-thumb {
    background: #2d4059;
}

body.dark .sc-modal-body::-webkit-scrollbar-thumb:hover {
    background: #3d5570;
}

body.dark .example-card {
    background: #16222e;
    border-color: #2d4059;
}

body.dark .example-card:hover {
    border-color: #11998e;
    background: #0d2a28;
}

body.dark .example-card-word {
    color: #6ee7b7;
}

body.dark .example-card-desc {
    color: #4a6070;
}

body.dark .example-tag {
    background: #0d2a28;
    color: #6ee7b7;
}

/* ========== 响应式布局 ========== */
/* 640px~899px：隐藏历史栏，中右两栏 */
@media (min-width: 640px) and (max-width: 899px) {
    .sc-history-panel {
        display: none;
    }

    .sc-input-panel {
        width: 300px;
        flex-shrink: 0;
    }

    .sc-result-panel {
        flex: 1;
        min-width: 0;
    }
}

/* ≤639px：纵向堆叠全部区域 */
@media (max-width: 639px) {
    .sc-main-content {
        flex-direction: column;
    }

    .sc-history-panel {
        width: 100%;
        height: 140px;
        border-right: none;
        border-bottom: 1px solid #e8edf3;
        flex-direction: row;
        flex-wrap: wrap;
    }

    body.dark .sc-history-panel {
        border-bottom-color: #2d4059;
    }

    .history-panel-header {
        width: 100%;
    }

    .history-search {
        width: 40%;
        border-bottom: none;
        border-right: 1px solid #e8edf3;
    }

    .history-list {
        flex: 1;
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        flex-direction: row;
        padding: 4px;
        gap: 6px;
    }

    .history-item {
        flex-shrink: 0;
        min-width: 110px;
        margin-bottom: 0;
    }

    .sc-input-panel {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e8edf3;
    }

    body.dark .sc-input-panel {
        border-bottom-color: #2d4059;
    }

    .sc-input-body {
        max-height: 300px;
    }

    .sc-result-panel {
        min-height: 380px;
    }

    .sc-toolbar {
        gap: 4px;
    }

    .toolbar-btn {
        padding: 4px 8px;
        font-size: 11px;
    }

    .sc-modal-body {
        grid-template-columns: 1fr;
    }
}
