/* =============================================
   语法纠错 - grammar_correction.css
   学术墨蓝主题配色，三栏布局
   暗黑模式使用 body.dark 作为父级选择器前缀
   ============================================= */

/* ========== 主容器 ========== */
.gc-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: #f0f6ff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(14, 54, 120, 0.12);
    transition: all 0.3s ease;
}

/* 全屏模式 */
.gc-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
    min-height: unset;
}

/* ========== 顶部工具栏 ========== */
.gc-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: linear-gradient(135deg, #0d2045 0%, #1d4ed8 60%, #0b1e45 100%);
    color: white;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: 0 2px 12px rgba(13, 32, 69, 0.4);
    flex-shrink: 0;
    border-bottom: 2px solid #60a5fa;
}

.gc-toolbar .toolbar-title {
    font-size: 13px;
    font-weight: 700;
    color: #bfdbfe;
    letter-spacing: 0.5px;
    margin-right: 8px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toolbar-group {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    min-height: 28px;
}

.toolbar-group--right {
    margin-left: auto;
}

.toolbar-btn {
    padding: 6px 12px;
    background: rgba(191, 219, 254, 0.9);
    border: 1px solid rgba(96, 165, 250, 0.45);
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #1e3a8a;
    transition: all 0.2s;
    white-space: nowrap;
}

.toolbar-btn:hover:not(:disabled) {
    background: #dbeafe;
    border-color: #3b82f6;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(13, 32, 69, 0.2);
}

.toolbar-btn:active:not(:disabled) {
    transform: translateY(0);
}

.toolbar-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.toolbar-btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: #fff !important;
    border: none;
    font-weight: 700;
    font-size: 13px;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.toolbar-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #60a5fa 0%, #2563eb 100%);
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.5);
}

/* ========== 表单校验抖动 ========== */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 50%, 90% { transform: translateX(-5px); }
    30%, 70% { transform: translateX(5px); }
}

.gc-textarea.shake {
    animation: shake 0.5s ease-in-out;
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12) !important;
}

/* ========== 主内容区：三栏 ========== */
.gc-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #f0f6ff;
}

/* ========== 左栏：历史记录 ========== */
.gc-history-panel {
    width: 200px;
    flex-shrink: 0;
    background: #e8f0fe;
    border-right: 1px solid #bfdbfe;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.history-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: linear-gradient(to bottom, #eff6ff 0%, #e8f0fe 100%);
    border-bottom: 1px solid #bfdbfe;
    flex-shrink: 0;
}

.history-panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #1e3a8a;
    border: none;
    padding: 0;
    background: none;
}

.history-count {
    font-size: 11px;
    color: #3b82f6;
    font-weight: 400;
}

.history-limit-footer {
    flex-shrink: 0;
    padding: 5px 8px;
    text-align: center;
    font-size: 10px;
    color: #93c5fd;
    border-top: 1px solid #bfdbfe;
    background: #e8f0fe;
    letter-spacing: 0.2px;
    user-select: none;
}

/* 历史面板清空按钮 */
.history-clear-btn {
    background: #fff0f0;
    border: none;
    color: #ef4444;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 7px;
    border-radius: 3px;
    transition: background 0.2s;
    white-space: nowrap;
}

.history-clear-btn:hover {
    background: #fde8e8;
}

.history-search {
    padding: 8px;
    border-bottom: 1px solid #bfdbfe;
    flex-shrink: 0;
    position: relative;
}

.history-search input {
    width: 100%;
    padding: 6px 26px 6px 10px;
    border: 1px solid #bfdbfe;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    color: #374151;
    background: #f5f9ff;
}

.history-search input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.history-search-clear {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #93c5fd;
    cursor: pointer;
    font-size: 15px;
    padding: 0 2px;
    line-height: 1;
    transition: color 0.15s;
    user-select: none;
}

.history-search-clear:hover {
    color: #1e3a8a;
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
}

.history-list::-webkit-scrollbar { width: 4px; }
.history-list::-webkit-scrollbar-track { background: transparent; }
.history-list:hover::-webkit-scrollbar-track { background: #dbeafe; }
.history-list::-webkit-scrollbar-thumb { background: #93c5fd; border-radius: 2px; }
.history-list::-webkit-scrollbar-thumb:hover { background: #3b82f6; }

.history-list.gc-list-loading {
    pointer-events: none;
    opacity: 0.45;
    transition: opacity 0.2s;
}

.history-empty {
    text-align: center;
    color: #3b82f6;
    font-size: 12px;
    padding: 24px 8px;
    user-select: none;
    opacity: 0.7;
}

@keyframes gcFadeIn {
    from { opacity: 0; transform: translateX(-4px); }
    to   { opacity: 1; transform: translateX(0); }
}

.history-item {
    display: flex;
    flex-direction: column;
    padding: 9px 11px;
    margin: 3px 0;
    background: #f5f9ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    animation: gcFadeIn 0.2s ease;
}

.history-item:hover {
    background: #e8f0fe;
    border-color: #3b82f6;
    transform: translateX(2px);
    box-shadow: inset 3px 0 0 #3b82f6;
}

.history-item.active {
    background: #dbeafe;
    border-color: #3b82f6;
    box-shadow: inset 3px 0 0 #1d4ed8, 0 1px 6px rgba(59, 130, 246, 0.25);
}

.history-item-del {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    background: #fde8e8;
    color: #ef4444;
    border: none;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s;
    padding: 0;
    line-height: 1;
}

.history-item:hover .history-item-del {
    opacity: 1;
}

.history-item-del:hover {
    background: #ef4444;
    color: #fff;
}

.history-item-name {
    font-size: 12px;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 20px;
}

.history-item-meta {
    font-size: 11px;
    color: #3b82f6;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 2px;
}

.history-item-time {
    font-size: 10px;
    color: #93c5fd;
}

/* ========== 中栏：表单输入 ========== */
.gc-input-panel {
    width: 320px;
    flex-shrink: 0;
    background: #f8fbff;
    border-right: 1px solid #bfdbfe;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ========== 右栏：结果展示 ========== */
.gc-result-panel {
    flex: 1;
    background: #f8fbff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 300px;
}

/* ========== 通用面板头部 ========== */
.panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: linear-gradient(to bottom, #eff6ff 0%, #e8f0fe 100%);
    border-bottom: 1px solid #bfdbfe;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(13, 32, 69, 0.07);
}

.panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: #1e3a8a;
    white-space: nowrap;
    border-left: 4px solid #3b82f6;
    padding-left: 8px;
}

.panel-tip {
    font-size: 11px;
    color: #3b82f6;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-meta {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex-shrink: 1;
}

.result-mode-tag {
    font-size: 11px;
    color: #1e3a8a;
    background: #dbeafe;
    padding: 2px 10px;
    border-radius: 10px;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 1;
    border: 1px solid #bfdbfe;
}

.result-time {
    font-size: 11px;
    color: #3b82f6;
    white-space: nowrap;
    flex-shrink: 0;
}

.result-regen-btn {
    flex-shrink: 0;
    padding: 3px 9px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.4);
    border-radius: 4px;
    color: #1e3a8a;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    line-height: 1.6;
}

.result-regen-btn:hover {
    background: rgba(59, 130, 246, 0.22);
    border-color: #3b82f6;
    transform: translateY(-1px);
}

.result-word-count {
    font-size: 11px;
    color: #93c5fd;
    white-space: nowrap;
    flex-shrink: 0;
    padding: 1px 7px;
    background: rgba(59, 130, 246, 0.08);
    border-radius: 8px;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* ========== 输入区 ========== */
.gc-input-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
}

.gc-input-body::-webkit-scrollbar { width: 4px; }
.gc-input-body::-webkit-scrollbar-track { background: transparent; }
.gc-input-body:hover::-webkit-scrollbar-track { background: #e8f0fe; }
.gc-input-body::-webkit-scrollbar-thumb { background: #93c5fd; border-radius: 2px; }
.gc-input-body::-webkit-scrollbar-thumb:hover { background: #3b82f6; }

/* textarea 内部滚动条 */
.gc-textarea::-webkit-scrollbar { width: 4px; }
.gc-textarea::-webkit-scrollbar-track { background: transparent; }
.gc-textarea:hover::-webkit-scrollbar-track { background: #dbeafe; }
.gc-textarea::-webkit-scrollbar-thumb { background: #93c5fd; border-radius: 2px; }
.gc-textarea::-webkit-scrollbar-thumb:hover { background: #3b82f6; }

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #1e3a8a;
    margin-bottom: 5px;
}

.required-mark {
    color: #ef4444;
    margin-left: 2px;
}

.label-tip {
    font-size: 11px;
    font-weight: 400;
    color: #9ca3af;
}

/* 文本域 */
.gc-textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid #bfdbfe;
    border-radius: 5px;
    font-size: 13px;
    color: #374151;
    background: #f5f9ff;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

.gc-textarea:focus {
    border-color: #3b82f6;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.gc-textarea:hover:not(:focus) {
    border-color: #60a5fa;
    background: #fff;
}

.gc-textarea::placeholder {
    color: #93c5fd;
    font-style: italic;
}

.gc-textarea:disabled {
    background: #eef4ff !important;
    color: #93b8e0 !important;
    cursor: not-allowed !important;
    opacity: 0.7;
    border-color: #bfdbfe !important;
    box-shadow: none !important;
}

/* 下拉选择框 */
.gc-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #bfdbfe;
    border-radius: 5px;
    font-size: 13px;
    color: #374151;
    background: #f5f9ff;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    font-family: inherit;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%233b82f6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-color: #f5f9ff;
    padding-right: 28px;
}

.gc-select:focus {
    border-color: #3b82f6;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.gc-select:hover:not(:focus) {
    border-color: #60a5fa;
    background-color: #fff;
}

.gc-select:disabled {
    background: #eef4ff !important;
    color: #93b8e0 !important;
    cursor: not-allowed !important;
    opacity: 0.7;
    border-color: #bfdbfe !important;
    box-shadow: none !important;
}

/* 模式说明提示 */
.gc-mode-hint {
    font-size: 11px;
    color: #2563eb;
    margin-top: 6px;
    padding: 5px 8px;
    background: rgba(59, 130, 246, 0.08);
    border-radius: 4px;
    border-left: 2px solid rgba(59, 130, 246, 0.4);
    line-height: 1.55;
    min-height: 22px;
    transition: opacity 0.2s;
}

/* 输入字符计数预警 */
.gc-char-count {
    font-size: 10px;
    text-align: right;
    margin-top: 3px;
    color: #9ca3af;
    min-height: 14px;
    line-height: 1;
    transition: color 0.2s;
}

.gc-char-count.warn {
    color: #f97316;
    font-weight: 600;
}

.gc-char-count.error {
    color: #ef4444;
    font-weight: 700;
}

.gc-generate-hint {
    margin-top: 8px;
    text-align: right;
}

.gc-hint-text {
    font-size: 11px;
    color: #93c5fd;
    user-select: none;
    font-style: italic;
}

/* ========== 结果区域 ========== */
.gc-result-body {
    flex: 1;
    overflow-y: auto;
    position: relative;
    display: flex;
    flex-direction: column;
    background: #f8fbff;
}

.gc-result-body::-webkit-scrollbar { width: 5px; }
.gc-result-body::-webkit-scrollbar-track { background: transparent; }
.gc-result-body:hover::-webkit-scrollbar-track { background: #e8f0fe; }
.gc-result-body::-webkit-scrollbar-thumb { background: #93c5fd; border-radius: 3px; }
.gc-result-body::-webkit-scrollbar-thumb:hover { background: #3b82f6; }

/* 占位提示 */
.result-placeholder {
    flex: 1;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 30px;
    text-align: center;
    user-select: none;
}

@keyframes gcPenFloat {
    0%, 100% { transform: translateY(0) rotate(-5deg); opacity: 0.85; }
    50%       { transform: translateY(-10px) rotate(5deg); opacity: 1; }
}

.placeholder-icon {
    font-size: 60px;
    margin-bottom: 18px;
    animation: gcPenFloat 3s ease-in-out infinite;
    display: inline-block;
}

.placeholder-title {
    font-size: 18px;
    font-weight: 700;
    color: #1e3a8a;
    margin: 0 0 10px;
}

.placeholder-desc {
    font-size: 13px;
    color: #3b82f6;
    margin: 4px 0;
    line-height: 1.65;
}

.placeholder-quote {
    margin-top: 26px;
    font-size: 13px;
    font-style: italic;
    color: #2563eb;
    padding: 12px 22px;
    border-left: 3px solid #3b82f6;
    text-align: left;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(13, 32, 69, 0.04) 100%);
    border-radius: 0 6px 6px 0;
    max-width: 360px;
    font-family: Georgia, serif;
}

/* 功能特性标签 */
.placeholder-feature-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 18px;
    margin-bottom: 2px;
}

.placeholder-pill {
    font-size: 11px;
    font-weight: 600;
    color: #1d4ed8;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    padding: 4px 12px;
    border-radius: 20px;
    white-space: nowrap;
    letter-spacing: 0.2px;
    user-select: none;
    transition: all 0.2s;
}

.placeholder-pill:hover {
    background: rgba(59, 130, 246, 0.18);
    border-color: #3b82f6;
    transform: translateY(-1px);
}

/* 加载动画 */
.result-loading {
    flex: 1;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    text-align: center;
}

@keyframes gcPenWrite {
    0%, 100% { transform: rotate(-10deg) translateY(0); opacity: 0.85; }
    50%       { transform: rotate(10deg) translateY(-8px); opacity: 1; }
}

.loading-icon-wrap {
    margin-bottom: 20px;
}

.loading-pen-icon {
    font-size: 48px;
    animation: gcPenWrite 1.6s ease-in-out infinite;
    display: inline-block;
}

/* 进度光条动画 */
@keyframes gcShimmer {
    0%   { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}

.gc-loading-bar {
    width: 220px;
    height: 4px;
    border-radius: 2px;
    margin: 0 auto 18px;
    background: linear-gradient(
        to right,
        rgba(59, 130, 246, 0.2) 0%,
        rgba(59, 130, 246, 0.8) 40%,
        rgba(13, 32, 69, 0.9) 60%,
        rgba(59, 130, 246, 0.2) 100%
    );
    background-size: 400px 4px;
    animation: gcShimmer 1.4s linear infinite;
}

.loading-text {
    font-size: 13px;
    color: #3b82f6;
    font-weight: 500;
    margin: 0;
}

/* 结果内容区 */
@keyframes gcResultFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.result-content {
    flex: 1;
    min-height: 0;
    padding: 24px 30px;
    font-size: 14px;
    line-height: 1.9;
    color: #374151;
    word-break: break-word;
    overflow-wrap: break-word;
    border-left: 4px solid #3b82f6;
    background: linear-gradient(to bottom, #f5f9ff 0%, #fff 60%);
}

.result-content.gc-result-enter {
    animation: gcResultFadeIn 0.35s ease-out forwards;
}

/* Markdown 内容样式 */
.result-content h1 {
    font-size: 19px;
    font-weight: 700;
    color: #1e3a8a;
    border-bottom: 2px solid rgba(59, 130, 246, 0.4);
    padding-bottom: 10px;
    margin: 4px 0 16px;
    letter-spacing: 0.3px;
}

.result-content h2 {
    font-size: 15px;
    font-weight: 700;
    color: #1e3a8a;
    border-left: 4px solid #3b82f6;
    margin: 20px 0 10px;
    background: rgba(59, 130, 246, 0.05);
    padding: 6px 8px;
    border-radius: 0 4px 4px 0;
}

.result-content h3 {
    font-size: 14px;
    font-weight: 700;
    color: #2563eb;
    margin: 16px 0 8px;
    padding-left: 4px;
}

.result-content h4 {
    font-size: 13px;
    font-weight: 700;
    color: #3b82f6;
    margin: 12px 0 6px;
    padding-left: 6px;
    border-left: 2px solid rgba(59, 130, 246, 0.5);
}

.result-content p {
    margin: 0 0 1.1em;
    line-height: 1.9;
}

.result-content p:last-child {
    margin-bottom: 0;
}

.result-content ul, .result-content ol {
    padding-left: 20px;
    margin: 8px 0 12px;
}

.result-content ul li, .result-content ol li {
    margin-bottom: 6px;
    line-height: 1.75;
}

.result-content ul li::marker {
    color: #3b82f6;
    font-weight: 600;
}

.result-content ol li::marker {
    color: #1d4ed8;
    font-weight: 600;
}

.result-content blockquote {
    margin: 14px 0;
    padding: 12px 18px;
    border-left: 4px solid #3b82f6;
    background: linear-gradient(to right, rgba(59, 130, 246, 0.08) 0%, rgba(59, 130, 246, 0.02) 100%);
    border-radius: 0 6px 6px 0;
    font-style: italic;
    color: #1d4ed8;
    font-size: 13.5px;
}

.result-content hr {
    border: none;
    border-top: 1px solid rgba(59, 130, 246, 0.25);
    margin: 18px 0;
}

.result-content code {
    background: rgba(59, 130, 246, 0.1);
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 13px;
    color: #1d4ed8;
    font-family: 'Consolas', 'Monaco', monospace;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.result-content strong {
    color: #1e3a8a;
    font-weight: 700;
}

.result-content em {
    color: #2563eb;
    font-style: italic;
}

/* 删除线（表示原文被修改） */
.result-content del, .result-content s {
    color: #ef4444;
    text-decoration: line-through;
    background: rgba(239, 68, 68, 0.06);
    padding: 0 2px;
    border-radius: 2px;
}

/* 错误状态 */
.result-content.result-content--error {
    border-left: none;
    display: flex;
    flex-direction: column;
    padding: 0;
    background: #f8fbff;
    animation: none;
}

.result-error-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    text-align: center;
    flex: 1;
    min-height: 200px;
}

.result-error-icon {
    font-size: 40px;
    margin-bottom: 16px;
    color: #f87171;
    line-height: 1;
}

.result-error-title {
    font-size: 14px;
    font-weight: 600;
    color: #dc2626;
    margin: 0 0 8px;
}

.result-error-hint {
    font-size: 12px;
    color: #9ca3af;
    margin: 0;
}

.error-retry-btn {
    margin-top: 18px;
    padding: 9px 24px;
    background: linear-gradient(135deg, #3b82f6 0%, #1e3a8a 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.35);
}

.error-retry-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.5);
}

/* ========== 示例模态框 ========== */
.gc-modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100000;
    backdrop-filter: blur(2px);
}

.gc-modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100001;
    width: 90%;
    max-width: 860px;
    max-height: 82vh;
    background: #f0f6ff;
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(13, 32, 69, 0.22);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: gcModalIn 0.22s ease-out;
}

@keyframes gcModalIn {
    from { opacity: 0; transform: translate(-50%, calc(-50% - 16px)); }
    to   { opacity: 1; transform: translate(-50%, -50%); }
}

.gc-modal-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.gc-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 2px solid #3b82f6;
    flex-shrink: 0;
    background: linear-gradient(135deg, #0d2045 0%, #1d4ed8 100%);
    color: #bfdbfe;
}

.gc-modal-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #dbeafe;
    border: none;
    padding: 0;
    background: none;
}

.gc-modal-close {
    background: rgba(191, 219, 254, 0.2);
    border: 1px solid rgba(191, 219, 254, 0.3);
    border-radius: 4px;
    color: #bfdbfe;
    cursor: pointer;
    font-size: 13px;
    padding: 4px 8px;
    transition: all 0.2s;
}

.gc-modal-close:hover {
    background: rgba(239, 68, 68, 0.7);
    border-color: rgba(239, 68, 68, 0.8);
    color: #fff;
}

.gc-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 12px;
    align-content: start;
}

.gc-modal-body::-webkit-scrollbar { width: 6px; }
.gc-modal-body::-webkit-scrollbar-track { background: #e8f0fe; border-radius: 3px; }
.gc-modal-body::-webkit-scrollbar-thumb { background: #93c5fd; border-radius: 3px; }
.gc-modal-body::-webkit-scrollbar-thumb:hover { background: #3b82f6; }

/* 示例卡片 */
.example-card {
    background: #fff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.example-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.18);
    transform: translateY(-2px);
}

.example-card-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #1e3a8a;
}

.example-card-badge {
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
}

.example-card-lang {
    font-size: 10px;
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
    padding: 1px 6px;
    border-radius: 8px;
    border: 1px solid rgba(59, 130, 246, 0.25);
    white-space: nowrap;
    margin-left: 6px;
}

.example-card-desc {
    font-size: 12px;
    color: #6b7280;
    margin: 4px 0 10px;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.example-card-preview {
    font-size: 11px;
    color: #374151;
    background: #f5f9ff;
    border: 1px solid #dbeafe;
    border-radius: 4px;
    padding: 6px 8px;
    margin-bottom: 10px;
    font-family: 'Consolas', 'Monaco', monospace;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-all;
}

.example-card-import {
    width: 100%;
    padding: 7px 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(29, 78, 216, 0.08) 100%);
    border: 1px solid rgba(59, 130, 246, 0.4);
    border-radius: 4px;
    color: #1e3a8a;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.example-card-import:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: #fff;
    border-color: transparent;
}

/* ========== 暗黑模式 ========== */
body.dark .gc-container {
    background: #0a1628;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
}

body.dark .gc-toolbar {
    background: linear-gradient(135deg, #060e1e 0%, #0d2045 60%, #060e1e 100%);
    border-bottom-color: #1d4ed8;
}

body.dark .gc-main-content {
    background: #0a1628;
}

/* 左栏暗黑 */
body.dark .gc-history-panel {
    background: #0d1f36;
    border-right-color: #1e3a6e;
}

body.dark .history-panel-header {
    background: linear-gradient(to bottom, #0f2548 0%, #0d1f36 100%);
    border-bottom-color: #1e3a6e;
}

body.dark .history-panel-header h3 {
    color: #93c5fd;
}

body.dark .history-count {
    color: #60a5fa;
}

body.dark .history-limit-footer {
    background: #0d1f36;
    border-top-color: #1e3a6e;
    color: #3b82f6;
}

body.dark .history-search {
    border-bottom-color: #1e3a6e;
}

body.dark .history-search input {
    background: #0a1628;
    border-color: #1e3a6e;
    color: #e2e8f0;
}

body.dark .history-search input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

body.dark .history-clear-btn {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

body.dark .history-clear-btn:hover {
    background: rgba(239, 68, 68, 0.2);
}

body.dark .history-search-clear {
    color: #3b82f6;
}

body.dark .history-search-clear:hover {
    color: #93c5fd;
}

/* dark mode 下各区域滚动条基础 track 色（非 hover 态也需覆盖） */
body.dark .history-list::-webkit-scrollbar-track { background: #091525; }
body.dark .history-list:hover::-webkit-scrollbar-track { background: #1a2d4e; }
body.dark .history-list::-webkit-scrollbar-thumb { background: #1d4ed8; }
body.dark .history-list::-webkit-scrollbar-thumb:hover { background: #3b82f6; }

body.dark .history-empty {
    color: #3b82f6;
}

body.dark .history-item {
    background: #0f2040;
    border-color: #1e3a6e;
}

body.dark .history-item:hover {
    background: #162b52;
    border-color: #3b82f6;
    box-shadow: inset 3px 0 0 #3b82f6;
}

body.dark .history-item.active {
    background: #1a3162;
    border-color: #3b82f6;
    box-shadow: inset 3px 0 0 #60a5fa, 0 1px 6px rgba(59, 130, 246, 0.3);
}

body.dark .history-item-del {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

body.dark .history-item-del:hover {
    background: rgba(239, 68, 68, 0.65);
    color: #fff;
}

body.dark .history-item-name {
    color: #93c5fd;
}

body.dark .history-item-meta {
    color: #3b82f6;
}

body.dark .history-item-time {
    color: #3b82f6;
}

/* 中栏暗黑 */
body.dark .gc-input-panel {
    background: #0d1f36;
    border-right-color: #1e3a6e;
}

body.dark .gc-result-panel {
    background: #0d1f36;
}

body.dark .panel-header {
    background: linear-gradient(to bottom, #0f2548 0%, #0d1f36 100%);
    border-bottom-color: #1e3a6e;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

body.dark .panel-header h3 {
    color: #93c5fd;
    border-left-color: #3b82f6;
}

body.dark .panel-tip {
    color: #3b82f6;
}

body.dark .result-mode-tag {
    color: #93c5fd;
    background: #162b52;
    border-color: #1e3a6e;
}

body.dark .result-time {
    color: #3b82f6;
}

body.dark .result-word-count {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.25);
}

body.dark .result-regen-btn {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.4);
    color: #93c5fd;
}

body.dark .result-regen-btn:hover {
    background: rgba(59, 130, 246, 0.28);
    border-color: #3b82f6;
}

body.dark .gc-input-body::-webkit-scrollbar-track { background: #091525; }
body.dark .gc-input-body:hover::-webkit-scrollbar-track { background: #1a2d4e; }
body.dark .gc-input-body::-webkit-scrollbar-thumb { background: #1d4ed8; }
body.dark .gc-input-body::-webkit-scrollbar-thumb:hover { background: #3b82f6; }

/* dark mode 下 textarea 滚动条 */
body.dark .gc-textarea::-webkit-scrollbar { width: 4px; }
body.dark .gc-textarea::-webkit-scrollbar-track { background: #091525; }
body.dark .gc-textarea:hover::-webkit-scrollbar-track { background: #1a2d4e; }
body.dark .gc-textarea::-webkit-scrollbar-thumb { background: #1d4ed8; border-radius: 2px; }
body.dark .gc-textarea::-webkit-scrollbar-thumb:hover { background: #3b82f6; }

body.dark .form-group label {
    color: #93c5fd;
}

body.dark .gc-textarea {
    background: #0a1628;
    border-color: #1e3a6e;
    color: #e2e8f0;
}

body.dark .gc-textarea:focus {
    border-color: #3b82f6;
    background: #0d1f36;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

body.dark .gc-textarea:hover:not(:focus) {
    border-color: #2563eb;
    background: #0d1f36;
}

body.dark .gc-textarea::placeholder {
    color: #1d4ed8;
}

body.dark .gc-textarea:disabled {
    background: #091525 !important;
    color: #1e3a6e !important;
    border-color: #162b52 !important;
}

body.dark .gc-select {
    background-color: #0a1628;
    border-color: #1e3a6e;
    color: #e2e8f0;
    color-scheme: dark;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2360a5fa'/%3E%3C/svg%3E");
}

body.dark .gc-select:focus {
    border-color: #3b82f6;
    background-color: #0d1f36;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

body.dark .gc-select:hover:not(:focus) {
    border-color: #2563eb;
    background-color: #0d1f36;
}

body.dark .gc-select:disabled {
    background: #091525 !important;
    color: #1e3a6e !important;
    border-color: #162b52 !important;
}

body.dark .gc-mode-hint {
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.1);
    border-left-color: rgba(59, 130, 246, 0.5);
}

body.dark .gc-char-count {
    color: #475569;
}

body.dark .gc-char-count.warn {
    color: #f97316;
}

body.dark .gc-char-count.error {
    color: #ef4444;
}

body.dark .gc-hint-text {
    color: #1e3a6e;
}

/* 右栏结果区暗黑 */
body.dark .gc-result-body {
    background: #0d1f36;
}

body.dark .gc-result-body::-webkit-scrollbar-track { background: #091525; }
body.dark .gc-result-body:hover::-webkit-scrollbar-track { background: #1a2d4e; }
body.dark .gc-result-body::-webkit-scrollbar-thumb { background: #1d4ed8; }
body.dark .gc-result-body::-webkit-scrollbar-thumb:hover { background: #3b82f6; }

body.dark .result-placeholder .placeholder-title {
    color: #93c5fd;
}

body.dark .result-placeholder .placeholder-desc {
    color: #3b82f6;
}

body.dark .result-placeholder .placeholder-pill {
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.35);
}

body.dark .result-placeholder .placeholder-pill:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
}

body.dark .result-placeholder .placeholder-quote {
    color: #60a5fa;
    border-left-color: #3b82f6;
    background: rgba(59, 130, 246, 0.08);
}

body.dark .result-loading .loading-text {
    color: #3b82f6;
}

body.dark .gc-loading-bar {
    background: linear-gradient(
        to right,
        rgba(29, 78, 216, 0.2) 0%,
        rgba(59, 130, 246, 0.9) 40%,
        rgba(96, 165, 250, 1) 60%,
        rgba(29, 78, 216, 0.2) 100%
    );
    background-size: 400px 4px;
}

body.dark .result-content {
    color: #e2e8f0;
    border-left-color: #2563eb;
    background: linear-gradient(to bottom, #0f2040 0%, #0d1f36 60%);
}

body.dark .result-content h1 {
    color: #93c5fd;
    border-bottom-color: rgba(59, 130, 246, 0.4);
}

body.dark .result-content h2 {
    color: #93c5fd;
    border-left-color: #3b82f6;
    background: rgba(59, 130, 246, 0.08);
}

body.dark .result-content h3 {
    color: #60a5fa;
}

body.dark .result-content h4 {
    color: #93c5fd;
    border-left-color: rgba(96, 165, 250, 0.5);
}

body.dark .result-content blockquote {
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.08);
    border-left-color: #3b82f6;
}

body.dark .result-content code {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.3);
}

body.dark .result-content strong {
    color: #93c5fd;
}

body.dark .result-content em {
    color: #60a5fa;
}

body.dark .result-content del, body.dark .result-content s {
    color: #f87171;
    background: rgba(239, 68, 68, 0.1);
}

body.dark .result-content hr {
    border-top-color: rgba(59, 130, 246, 0.2);
}

body.dark .result-content ul li::marker {
    color: #3b82f6;
}

body.dark .result-content ol li::marker {
    color: #60a5fa;
}

body.dark .result-content--error {
    background: #0d1f36;
}

/* dark mode 错误状态完整样式（规范要求） */
body.dark .result-error-block {
    background: transparent;
}

body.dark .result-error-icon {
    color: #f87171;
}

body.dark .result-error-title {
    color: #f87171;
}

body.dark .result-error-hint {
    color: #64748b;
}

body.dark .error-retry-btn {
    background: linear-gradient(135deg, #1d4ed8 0%, #0d2045 100%);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

body.dark .error-retry-btn:hover {
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.45);
}

/* 示例模态框暗黑 */
body.dark .gc-modal {
    background: #0d1f36;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

body.dark .gc-modal-header {
    background: linear-gradient(135deg, #060e1e 0%, #0d2045 100%);
}

body.dark .gc-modal-body {
    background: #0d1f36;
}

body.dark .gc-modal-body::-webkit-scrollbar-track { background: #0a1628; }
body.dark .gc-modal-body::-webkit-scrollbar-thumb { background: #1d4ed8; }
body.dark .gc-modal-body::-webkit-scrollbar-thumb:hover { background: #3b82f6; }

body.dark .example-card {
    background: #0f2040;
    border-color: #1e3a6e;
}

body.dark .example-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.2);
}

body.dark .example-card-title {
    color: #93c5fd;
}

body.dark .example-card-desc {
    color: #94a3b8;
}

body.dark .example-card-preview {
    color: #cbd5e1;
    background: #0a1628;
    border-color: #1e3a6e;
}

body.dark .example-card-import {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.35);
    color: #93c5fd;
}

body.dark .example-card-import:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #fff;
}

/* ========== 响应式布局 ========== */
@media (max-width: 900px) {
    .gc-history-panel { display: none; }
    .gc-input-panel {
        width: 280px;
        min-width: 240px;
    }
}

@media (max-width: 640px) {
    .gc-main-content { flex-direction: column; }
    .gc-input-panel {
        width: 100%;
        max-height: 320px;
        border-right: none;
        border-bottom: 1px solid #bfdbfe;
    }
    .gc-result-panel { min-width: unset; }
    .toolbar-title { display: none; }
}

/* ========== 打印样式 ========== */
@media print {
    .gc-toolbar,
    .gc-history-panel,
    .gc-input-panel,
    #resultPlaceholder,
    #resultLoading,
    #resultMeta,
    #regenerateBtn,
    #copyBtn {
        display: none !important;
    }
    .gc-container {
        position: static !important;
        height: auto !important;
        box-shadow: none !important;
    }
    .gc-main-content {
        display: block !important;
    }
    .gc-result-panel {
        width: 100% !important;
    }
    .gc-result-body {
        overflow: visible !important;
    }
    .result-content {
        border-left: none !important;
        padding: 0 !important;
    }
}
