/* =============================================
   写情书 - love_letter_writing.css
   玫瑰粉红主题：粉玫瑰色调、心形装饰、柔美温馨
   暗黑模式以 body.dark 为父级选择器前缀
   ============================================= */

/* ========== CSS 变量 ========== */
:root {
    --ll-primary:        #c2185b;
    --ll-primary-light:  #e91e63;
    --ll-rose:           #e91e63;
    --ll-pink:           #f48fb1;
    --ll-pink-pale:      #fce4ec;
    --ll-bg:             #fff8fa;
    --ll-panel-bg:       #ffffff;
    --ll-border:         #f8d7e3;
    --ll-text:           #3d1a28;
    --ll-text-sub:       #8c3a5a;
    --ll-text-muted:     #c07898;
    --ll-tag-bg:         #fff0f5;
    --ll-tag-border:     #f8d7e3;
    --ll-tag-hover-bg:   #fce4ec;
    --ll-shadow:         rgba(194, 24, 91, 0.12);
    --ll-letter-bg:      #fffbfc;
    --ll-letter-line:    #fce4ec;
}

/* ========== 主容器 ========== */
.ll-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: var(--ll-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 16px var(--ll-shadow);
    transition: all 0.3s ease;
}

/* 全屏模式 */
.ll-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;
}

/* ========== 顶部工具栏 ========== */
.ll-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: linear-gradient(135deg, #880e4f 0%, #c2185b 55%, #e91e63 100%);
    color: #fff;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: 0 2px 12px rgba(136, 14, 79, 0.45);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

/* 工具栏心形纹样装饰 */
.ll-toolbar::before {
    content: '♥ ♡ ♥ ♡ ♥ ♡ ♥ ♡ ♥ ♡';
    position: absolute;
    top: 0; right: 0;
    font-size: 14px;
    color: rgba(248, 187, 208, 0.18);
    letter-spacing: 8px;
    pointer-events: none;
    white-space: nowrap;
    padding: 5px 10px;
}

.toolbar-title {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
    letter-spacing: 1px;
    margin-right: 6px;
}

.toolbar-group-right {
    margin-left: auto;
}

.toolbar-group {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    min-height: 28px;
    position: relative;
    z-index: 1;
}

.toolbar-btn {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.92);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #880e4f;
    transition: all 0.2s;
    white-space: nowrap;
}

.toolbar-btn:hover:not(:disabled) {
    background: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
}

.toolbar-btn:active:not(:disabled) {
    transform: translateY(0);
}

.toolbar-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

/* AI生成主按钮 */
.toolbar-btn-primary {
    background: linear-gradient(135deg, #f06292 0%, #f48fb1 100%);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(240, 98, 146, 0.5);
}

.toolbar-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #e91e63 0%, #f06292 100%);
    box-shadow: 0 4px 14px rgba(233, 30, 99, 0.55);
    color: #fff;
}

.toolbar-btn-primary:disabled {
    background: rgba(240, 98, 146, 0.32);
    color: rgba(255, 255, 255, 0.5);
    box-shadow: none;
}

/* 取消按钮 */
.toolbar-btn-cancel {
    background: linear-gradient(135deg, #ef5350 0%, #d32f2f 100%);
    color: #fff;
}

.toolbar-btn-cancel:hover:not(:disabled) {
    background: linear-gradient(135deg, #ef9a9a 0%, #ef5350 100%);
    color: #fff;
}

/* ========== 主内容区：三栏 ========== */
.ll-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: var(--ll-bg);
}

/* ========== 左栏：历史记录 ========== */
.ll-history-panel {
    width: 210px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid var(--ll-border);
    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, #fff8fa 0%, #fce4ec 100%);
    border-bottom: 1px solid var(--ll-border);
    flex-shrink: 0;
}

.history-panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--ll-primary);
    border-left: 2px solid var(--ll-pink);
    padding-left: 6px;
}

.history-count {
    font-size: 11px;
    color: var(--ll-text-muted);
    font-weight: 400;
}

.history-clear-btn {
    background: #fff0f5;
    border: none;
    border-radius: 3px;
    color: var(--ll-primary);
    font-size: 11px;
    padding: 3px 7px;
    cursor: pointer;
    transition: background 0.2s;
}

.history-clear-btn:hover {
    background: #fce4ec;
}

.history-search {
    padding: 8px 10px;
    border-bottom: 1px solid var(--ll-border);
    flex-shrink: 0;
}

.history-search input {
    width: 100%;
    box-sizing: border-box;
    padding: 5px 8px;
    border: 1px solid var(--ll-border);
    border-radius: 4px;
    font-size: 12px;
    color: var(--ll-text);
    background: #fffbfc;
    outline: none;
    transition: border-color 0.2s;
}

.history-search input:focus {
    border-color: var(--ll-pink);
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px 0;
}

.history-empty {
    padding: 24px 14px;
    text-align: center;
    color: var(--ll-text-muted);
    font-size: 12px;
}

.history-item {
    padding: 10px 14px;
    border-bottom: 1px solid #fef0f5;
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
}

.history-item:hover {
    background: var(--ll-tag-hover-bg);
}

.history-item.active {
    background: #fce4ec;
    border-left: 3px solid var(--ll-primary);
}

.history-item-occasion {
    font-size: 11px;
    color: var(--ll-primary);
    font-weight: 600;
    margin-bottom: 3px;
}

.history-item-title {
    font-size: 12px;
    color: var(--ll-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.history-item-meta {
    font-size: 11px;
    color: var(--ll-text-muted);
}

.history-item-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 3px;
    transition: all 0.15s;
    display: none;
}

.history-item:hover .history-item-delete {
    display: block;
}

.history-item-delete:hover {
    color: var(--ll-primary);
    background: #fce4ec;
}

/* ========== 中栏：表单输入 ========== */
.ll-input-panel {
    width: 340px;
    flex-shrink: 0;
    background: #fffbfc;
    border-right: 1px solid var(--ll-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    padding: 12px 16px 10px;
    border-bottom: 1px solid var(--ll-border);
    background: linear-gradient(to bottom, #fff8fa 0%, #fce4ec 100%);
    flex-shrink: 0;
}

.panel-header h3 {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 700;
    color: var(--ll-primary);
    border-left: 2px solid var(--ll-pink);
    padding-left: 6px;
}

.panel-tip {
    font-size: 11px;
    color: var(--ll-text-muted);
}

.ll-input-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 14px 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-row {
    display: flex;
    gap: 10px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group-half {
    flex: 1;
    min-width: 0;
}

.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--ll-text-sub);
}

.required-mark {
    color: var(--ll-primary);
    font-size: 13px;
    margin-left: 2px;
}

.label-tip {
    font-size: 11px;
    color: var(--ll-text-muted);
    font-weight: 400;
    margin-left: 2px;
}

.ll-select {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--ll-border);
    border-radius: 5px;
    font-size: 12px;
    color: var(--ll-text);
    background: #fffbfc;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23c07898' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-color: #fffbfc;
    padding-right: 28px;
}

.ll-select:focus {
    border-color: var(--ll-pink);
    box-shadow: 0 0 0 2px rgba(244, 143, 177, 0.2);
}

.ll-input {
    width: 100%;
    box-sizing: border-box;
    padding: 7px 10px;
    border: 1px solid var(--ll-border);
    border-radius: 5px;
    font-size: 12px;
    color: var(--ll-text);
    background: #fffbfc;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ll-input:focus {
    border-color: var(--ll-pink);
    box-shadow: 0 0 0 2px rgba(244, 143, 177, 0.2);
}

.ll-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 10px;
    border: 1px solid var(--ll-border);
    border-radius: 5px;
    font-size: 13px;
    color: var(--ll-text);
    background: #fffbfc;
    resize: vertical;
    outline: none;
    line-height: 1.6;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
    min-height: 90px;
}

.ll-textarea:focus {
    border-color: var(--ll-pink);
    box-shadow: 0 0 0 2px rgba(244, 143, 177, 0.2);
}

.ll-textarea-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2px;
}

.ll-textarea-hint {
    font-size: 11px;
    color: var(--ll-text-muted);
}

.feelings-char-count {
    font-size: 11px;
    color: var(--ll-text-muted);
}

/* 篇幅选择按钮组 */
.length-options {
    display: flex;
    gap: 8px;
}

.length-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 7px 6px;
    border: 1px solid var(--ll-border);
    border-radius: 6px;
    background: #fffbfc;
    font-size: 12px;
    font-weight: 600;
    color: var(--ll-text-sub);
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1.4;
}

.length-btn span {
    font-size: 10px;
    font-weight: 400;
    color: var(--ll-text-muted);
    margin-top: 1px;
}

.length-btn:hover {
    border-color: var(--ll-pink);
    background: var(--ll-tag-hover-bg);
    color: var(--ll-primary);
}

.length-btn.active {
    border-color: var(--ll-primary);
    background: var(--ll-pink-pale);
    color: var(--ll-primary);
    box-shadow: 0 0 0 2px rgba(194, 24, 91, 0.15);
}

.length-btn.active span {
    color: var(--ll-primary);
    opacity: 0.7;
}

/* 心情标签 */
.tag-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--ll-text-sub);
    margin-bottom: 2px;
}

.mood-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.mood-tag {
    padding: 5px 10px;
    background: var(--ll-tag-bg);
    border: 1px solid var(--ll-tag-border);
    border-radius: 20px;
    font-size: 12px;
    color: var(--ll-text-sub);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.mood-tag:hover {
    background: var(--ll-tag-hover-bg);
    border-color: var(--ll-pink);
    color: var(--ll-primary);
    transform: translateY(-1px);
}

/* shake 动画 */
@keyframes llShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-5px); }
    40% { transform: translateX(5px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.shake { animation: llShake 0.4s ease; }

/* ========== 右栏：结果展示 ========== */
.ll-result-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--ll-bg);
}

.result-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.result-meta-occasion {
    font-size: 11px;
    padding: 2px 8px;
    background: #fce4ec;
    color: var(--ll-primary);
    border-radius: 10px;
    font-weight: 600;
}

.result-style-badge {
    font-size: 11px;
    padding: 2px 8px;
    background: #fff0f5;
    color: #c2185b;
    border-radius: 10px;
    border: 1px solid var(--ll-border);
}

.result-char-count {
    font-size: 11px;
    color: var(--ll-text-muted);
    padding: 2px 7px;
    background: #fce4ec;
    border-radius: 8px;
    font-weight: 500;
    margin-left: auto;
}

.result-time {
    font-size: 11px;
    color: var(--ll-text-muted);
}

.ll-result-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
    scroll-behavior: smooth;
    display: flex;
    flex-direction: column;
}

/* 初始占位 */
.result-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 300px;
    gap: 10px;
}

.placeholder-heart {
    font-size: 64px;
    animation: llHeartBeat 2s ease-in-out infinite;
    filter: drop-shadow(0 4px 12px rgba(194, 24, 91, 0.25));
}

@keyframes llHeartBeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.12); }
}

.placeholder-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--ll-text-sub);
    margin: 0;
}

.placeholder-desc {
    font-size: 13px;
    color: var(--ll-text-muted);
    margin: 0;
}

.placeholder-tags {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.apology-tag {
    padding: 4px 12px;
    background: #fce4ec;
    border: 1px solid var(--ll-border);
    border-radius: 20px;
    font-size: 12px;
    color: var(--ll-text-sub);
    cursor: default;
    transition: all 0.2s;
}

.apology-tag:hover {
    background: #f8bbd0;
    transform: scale(1.04);
}

/* 加载中 */
.result-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 300px;
    gap: 14px;
}

.loading-hearts {
    display: flex;
    gap: 10px;
}

.loading-heart {
    font-size: 32px;
    animation: llHeartPop 1.2s ease-in-out infinite;
    filter: drop-shadow(0 2px 6px rgba(194, 24, 91, 0.3));
}

.loading-heart:nth-child(2) { animation-delay: 0.2s; }
.loading-heart:nth-child(3) { animation-delay: 0.4s; }

@keyframes llHeartPop {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.25); opacity: 0.75; }
}

.loading-dots {
    display: flex;
    gap: 6px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: var(--ll-pink);
    border-radius: 50%;
    animation: llDotPulse 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 llDotPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.5; }
}

.loading-text {
    font-size: 14px;
    color: var(--ll-text-sub);
    font-weight: 500;
    letter-spacing: 1px;
}

/* 错误块 */
.result-error-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex: 1;
    min-height: 300px;
}

.result-error-icon {
    font-size: 40px;
}

.result-error-msg {
    font-size: 14px;
    color: #c2185b;
    text-align: center;
    max-width: 320px;
    line-height: 1.5;
    margin: 0;
}

.ll-retry-btn {
    padding: 8px 22px;
    background: linear-gradient(135deg, var(--ll-primary) 0%, var(--ll-primary-light) 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.ll-retry-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(194, 24, 91, 0.4);
}

/* ========== 情书卡片 ========== */
.result-content {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.letter-card {
    background: var(--ll-letter-bg);
    border: 1px solid var(--ll-border);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(194, 24, 91, 0.08);
    position: relative;
}

/* 信封口装饰 */
.letter-card::before {
    content: '';
    display: block;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #880e4f, #e91e63, #f48fb1, #e91e63, #880e4f);
    background-size: 200% 100%;
    animation: llGradientShift 4s linear infinite;
}

@keyframes llGradientShift {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

.letter-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px 10px;
    border-bottom: 1px dashed var(--ll-border);
    background: linear-gradient(to bottom, #fff5f8 0%, #fffbfc 100%);
}

.letter-card-occasion {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--ll-primary);
    font-weight: 600;
    padding: 3px 10px;
    background: #fce4ec;
    border-radius: 12px;
}

.letter-card-actions {
    display: flex;
    gap: 8px;
}

.letter-copy-btn {
    padding: 5px 12px;
    background: #fff;
    border: 1px solid var(--ll-border);
    border-radius: 4px;
    font-size: 12px;
    color: var(--ll-text-sub);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.letter-copy-btn:hover {
    border-color: var(--ll-pink);
    color: var(--ll-primary);
    background: var(--ll-tag-hover-bg);
}

.letter-copy-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

/* 情书正文区域 */
.letter-body {
    padding: 24px 28px 20px;
    position: relative;
    background: var(--ll-letter-bg);
}

/* 信纸横线装饰 */
.letter-body::before {
    content: '';
    position: absolute;
    top: 24px;
    left: 28px;
    right: 28px;
    bottom: 20px;
    background-image: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 27px,
        var(--ll-letter-line) 27px,
        var(--ll-letter-line) 28px
    );
    pointer-events: none;
    opacity: 0.5;
}

.letter-text {
    font-size: 14.5px;
    line-height: 28px;
    color: var(--ll-text);
    white-space: pre-wrap;
    word-break: break-word;
    font-family: "STKaiti", "楷体", "KaiTi", "Georgia", serif;
    position: relative;
    z-index: 1;
    letter-spacing: 0.3px;
}

/* 结尾花签装饰 */
.letter-footer {
    padding: 10px 18px 14px;
    border-top: 1px dashed var(--ll-border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    background: linear-gradient(to top, #fff5f8 0%, #fffbfc 100%);
}

.letter-footer-heart {
    font-size: 14px;
    animation: llFooterHeartPulse 2s ease-in-out infinite;
}

@keyframes llFooterHeartPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.letter-footer-text {
    font-size: 12px;
    color: var(--ll-text-muted);
    font-style: italic;
}

/* 入场动画 */
@keyframes llResultEnter {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.result-content.result-enter-anim {
    animation: llResultEnter 0.35s ease both;
}

/* ========== 示例模态框 ========== */
.ll-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 10000;
}

.ll-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 660px;
    max-width: calc(100vw - 32px);
    max-height: 80vh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(194, 24, 91, 0.2);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ll-modal-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.ll-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--ll-border);
    flex-shrink: 0;
    background: linear-gradient(to bottom, #fff8fa 0%, #fce4ec 100%);
}

.ll-modal-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--ll-primary);
}

.ll-modal-close {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: var(--ll-text-muted);
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.ll-modal-close:hover {
    background: #fce4ec;
    color: var(--ll-primary);
}

.ll-modal-body {
    padding: 16px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.example-card {
    padding: 14px;
    border: 1px solid var(--ll-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fffbfc;
}

.example-card:hover {
    border-color: var(--ll-pink);
    background: var(--ll-tag-hover-bg);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(244, 143, 177, 0.22);
}

.example-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.example-card-icon { font-size: 20px; flex-shrink: 0; }

.example-card-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--ll-text);
    flex: 1;
}

.example-card-badge {
    font-size: 11px;
    padding: 2px 8px;
    background: #fce4ec;
    color: var(--ll-primary);
    border-radius: 10px;
    font-weight: 600;
    white-space: nowrap;
}

.example-card-desc {
    font-size: 12px;
    color: var(--ll-text-muted);
    line-height: 1.5;
}

/* ========== Toast 提示 ========== */
.ll-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 9px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    z-index: 99999;
    pointer-events: none;
    opacity: 0;
    transition: all 0.3s ease;
    white-space: nowrap;
    max-width: calc(100vw - 40px);
}

.ll-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.ll-toast.success { background: #e91e63; color: #fff; box-shadow: 0 4px 16px rgba(233, 30, 99, 0.35); }
.ll-toast.error   { background: #d32f2f; color: #fff; box-shadow: 0 4px 16px rgba(211, 47, 47, 0.35); }
.ll-toast.info    { background: #424242; color: #fff; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28); }

/* ========== 滚动条美化 ========== */
.ll-history-panel ::-webkit-scrollbar,
.ll-input-body::-webkit-scrollbar,
.ll-result-body::-webkit-scrollbar { width: 5px; }

.ll-history-panel ::-webkit-scrollbar-track,
.ll-input-body::-webkit-scrollbar-track,
.ll-result-body::-webkit-scrollbar-track { background: transparent; }

.ll-history-panel ::-webkit-scrollbar-thumb,
.ll-input-body::-webkit-scrollbar-thumb,
.ll-result-body::-webkit-scrollbar-thumb {
    background: #f8d7e3;
    border-radius: 3px;
}

.ll-history-panel ::-webkit-scrollbar-thumb:hover,
.ll-input-body::-webkit-scrollbar-thumb:hover,
.ll-result-body::-webkit-scrollbar-thumb:hover {
    background: var(--ll-pink);
}

/* ========== 响应式 ========== */
@media (max-width: 900px) {
    .ll-history-panel { display: none; }
    .ll-input-panel { width: 300px; }
}

@media (max-width: 600px) {
    .ll-input-panel { width: 100%; border-right: none; }
    .ll-result-panel { display: none; }
    .ll-main-content { flex-direction: column; }
}

/* ============================================================
   暗黑模式 — 所有规则以 body.dark 为父级选择器前缀
   ============================================================ */
body.dark .ll-container {
    background: #1a0a12;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.5);
}

body.dark .ll-toolbar {
    background: linear-gradient(135deg, #4a0020 0%, #880e4f 55%, #c2185b 100%);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

body.dark .ll-main-content {
    background: #1a0a12;
}

body.dark .ll-history-panel {
    background: #1e0d16;
    border-right-color: #3d1a28;
}

body.dark .history-panel-header {
    background: linear-gradient(to bottom, #1e0d16 0%, #2a1020 100%);
    border-bottom-color: #3d1a28;
}

body.dark .history-panel-header h3 {
    color: #f48fb1;
    border-left-color: #e91e63;
}

body.dark .history-count { color: #8c4a64; }

body.dark .history-clear-btn {
    background: #2a1020;
    color: #f48fb1;
}

body.dark .history-clear-btn:hover { background: #3d1a28; }

body.dark .history-search { border-bottom-color: #3d1a28; }

body.dark .history-search input {
    border-color: #3d1a28;
    background: #1e0d16;
    color: #f8d7e3;
}

body.dark .history-search input:focus { border-color: #e91e63; }

body.dark .history-item { border-bottom-color: #2a1020; }

body.dark .history-item:hover { background: #2a1020; }

body.dark .history-item.active {
    background: #3d1a28;
    border-left-color: #e91e63;
}

body.dark .history-item-occasion { color: #f48fb1; }
body.dark .history-item-title { color: #f8d7e3; }
body.dark .history-item-meta { color: #8c4a64; }
body.dark .history-empty { color: #8c4a64; }

body.dark .history-item-delete { color: #5a2a3a; }
body.dark .history-item-delete:hover {
    color: #f48fb1;
    background: #3d1a28;
}

body.dark .ll-input-panel {
    background: #1e0d16;
    border-right-color: #3d1a28;
}

body.dark .panel-header {
    background: linear-gradient(to bottom, #1e0d16 0%, #2a1020 100%);
    border-bottom-color: #3d1a28;
}

body.dark .panel-header h3 {
    color: #f48fb1;
    border-left-color: #e91e63;
}

body.dark .panel-tip { color: #8c4a64; }

body.dark .ll-input-body { scrollbar-color: #3d1a28 transparent; }

body.dark .form-group label { color: #c07898; }

body.dark .ll-select {
    background-color: #1e0d16;
    border-color: #3d1a28;
    color: #f8d7e3;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23c07898' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
}

body.dark .ll-select:focus {
    border-color: #e91e63;
    box-shadow: 0 0 0 2px rgba(233, 30, 99, 0.2);
}

body.dark .ll-input {
    background: #1e0d16;
    border-color: #3d1a28;
    color: #f8d7e3;
}

body.dark .ll-input:focus {
    border-color: #e91e63;
    box-shadow: 0 0 0 2px rgba(233, 30, 99, 0.2);
}

body.dark .ll-textarea {
    background: #1e0d16;
    border-color: #3d1a28;
    color: #f8d7e3;
}

body.dark .ll-textarea:focus {
    border-color: #e91e63;
    box-shadow: 0 0 0 2px rgba(233, 30, 99, 0.2);
}

body.dark .ll-textarea-hint { color: #8c4a64; }
body.dark .feelings-char-count { color: #8c4a64; }

body.dark .length-btn {
    background: #1e0d16;
    border-color: #3d1a28;
    color: #c07898;
}

body.dark .length-btn span { color: #8c4a64; }

body.dark .length-btn:hover {
    border-color: #e91e63;
    background: #2a1020;
    color: #f48fb1;
}

body.dark .length-btn.active {
    border-color: #e91e63;
    background: #3d1a28;
    color: #f48fb1;
    box-shadow: 0 0 0 2px rgba(233, 30, 99, 0.2);
}

body.dark .length-btn.active span { color: #f48fb1; opacity: 0.7; }

body.dark .mood-tag {
    background: #2a1020;
    border-color: #3d1a28;
    color: #c07898;
}

body.dark .mood-tag:hover {
    background: #3d1a28;
    border-color: #e91e63;
    color: #f48fb1;
    transform: translateY(-1px);
}

body.dark .ll-result-panel { background: #1a0a12; }

body.dark .result-meta-occasion {
    background: #3d1a28;
    color: #f48fb1;
}

body.dark .result-style-badge {
    background: #2a1020;
    color: #f48fb1;
    border-color: #3d1a28;
}

body.dark .result-char-count {
    color: #c07898;
    background: #2a1020;
}

body.dark .result-time { color: #8c4a64; }

body.dark .ll-result-body { scrollbar-color: #3d1a28 transparent; }

body.dark .placeholder-title { color: #c07898; }
body.dark .placeholder-desc { color: #8c4a64; }

body.dark .apology-tag {
    background: #2a1020;
    border-color: #3d1a28;
    color: #c07898;
}

body.dark .apology-tag:hover { background: #3a1522; transform: scale(1.04); }

body.dark .loading-text { color: #c07898; }

body.dark .loading-dots span { background: #e91e63; }

body.dark .result-error-msg { color: #f48fb1; }

body.dark .ll-retry-btn {
    background: linear-gradient(135deg, #880e4f 0%, #c2185b 100%);
}

body.dark .ll-retry-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(194, 24, 91, 0.5);
}

body.dark .letter-card {
    background: #1e0d16;
    border-color: #3d1a28;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

body.dark .letter-card-header {
    background: linear-gradient(to bottom, #1e0d16 0%, #2a1020 100%);
    border-bottom-color: #3d1a28;
}

body.dark .letter-card-occasion {
    background: #3d1a28;
    color: #f48fb1;
}

body.dark .letter-copy-btn {
    background: #2a1020;
    border-color: #3d1a28;
    color: #c07898;
}

body.dark .letter-copy-btn:hover {
    border-color: #e91e63;
    color: #f48fb1;
    background: #3d1a28;
}

body.dark .letter-body {
    background: #1e0d16;
}

body.dark .letter-body::before {
    background-image: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 27px,
        #3d1a28 27px,
        #3d1a28 28px
    );
    opacity: 0.4;
}

body.dark .letter-text {
    color: #f8d7e3;
}

body.dark .letter-footer {
    background: linear-gradient(to top, #1e0d16 0%, #2a1020 100%);
    border-top-color: #3d1a28;
}

body.dark .letter-footer-text { color: #8c4a64; }

body.dark .ll-modal {
    background: #1e0d16;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

body.dark .ll-modal-header {
    background: linear-gradient(to bottom, #1e0d16 0%, #2a1020 100%);
    border-bottom-color: #3d1a28;
}

body.dark .ll-modal-header h3 { color: #f48fb1; }

body.dark .ll-modal-close { color: #8c4a64; }
body.dark .ll-modal-close:hover {
    background: #3d1a28;
    color: #f48fb1;
}

body.dark .example-card {
    background: #1e0d16;
    border-color: #3d1a28;
}

body.dark .example-card:hover {
    border-color: #e91e63;
    background: #2a1020;
    box-shadow: 0 4px 12px rgba(233, 30, 99, 0.2);
    transform: translateY(-2px);
}

body.dark .example-card-title { color: #f8d7e3; }

body.dark .example-card-badge {
    background: #3d1a28;
    color: #f48fb1;
}

body.dark .example-card-desc { color: #8c4a64; }

body.dark .ll-history-panel ::-webkit-scrollbar-thumb,
body.dark .ll-input-body::-webkit-scrollbar-thumb,
body.dark .ll-result-body::-webkit-scrollbar-thumb {
    background: #3d1a28;
}

body.dark .ll-history-panel ::-webkit-scrollbar-thumb:hover,
body.dark .ll-input-body::-webkit-scrollbar-thumb:hover,
body.dark .ll-result-body::-webkit-scrollbar-thumb:hover {
    background: #e91e63;
}
