/* 哎呦笔记 - 首页样式 */
/* CSS 变量定义（与编辑器共享） */
:root {
    --bg: #f3f4f6;
    --card: #fff;
    --text: #1f2937;
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --border: #e5e7eb;
    --sub-text: #6b7280;
}

html.dark {
    --bg: #111827;
    --card: #1f2937;
    --text: #f9fafb;
    --border: #374151;
    --sub-text: #9ca3af;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    transition: background 0.3s, color 0.3s;
}

/* ── 卡片 ── */
.card {
    background: var(--card);
    padding: 3rem 2.5rem;
    border-radius: 24px;
    box-shadow:
        0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -1px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 420px;
    text-align: center;
    position: relative;
    transition: box-shadow 0.3s ease;
}

.icon-wrapper {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    display: inline-block;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

h1 {
    margin: 0.5rem 0;
    font-size: 1.8rem;
}

p.subtitle {
    color: var(--sub-text);
    margin-bottom: 2rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* ── 输入框 ── */
input[type="text"] {
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 1.5rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    box-sizing: border-box;
    background: var(--bg);
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* ── 按钮组 ── */
.btn-group {
    display: flex;
    gap: 12px;
    margin-bottom: 2rem;
}

.btn {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-weight: bold;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s, transform 0.2s, border-color 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.2);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--card);
    color: var(--text);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

/* ── 预览区域 ── */
.preview-area {
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
    text-align: left;
}

.preview-label {
    font-size: 0.85rem;
    color: var(--sub-text);
    margin-bottom: 0.5rem;
    display: block;
    text-align: left;
}

.preview-box {
    background: var(--bg);
    padding: 12px;
    border-radius: 8px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    color: var(--sub-text);
    word-break: break-all;
    text-align: center;
    display: block;
    width: 100%;
    box-sizing: border-box;
}

.preview-box span {
    color: var(--primary);
    font-weight: bold;
}

/* ── 设置区域（右上角）── */
.settings-area {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 15px;
    align-items: center;
}

.icon-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text);
    opacity: 0.7;
    transition: opacity 0.2s, background 0.2s;
    padding: 5px;
    border-radius: 50%;
}

.icon-btn:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.05);
}

html.dark .icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ── 语言下拉包装器 ── */
.lang-dropdown-wrapper {
    position: relative;
}

/* ── 语言下拉菜单 ── */
.lang-dropdown {
    position: absolute;
    top: 50px;
    right: 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: none;
    z-index: 100;
    min-width: 120px;
    overflow: hidden;
}

.lang-dropdown.show {
    display: block;
}

.lang-option {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    color: var(--text);
    font-size: 0.9rem;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.lang-option:hover {
    background: var(--bg);
    color: var(--primary);
}

.lang-option.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    font-weight: bold;
}
