:root {
    --indigo-600: #4f46e5;
    --indigo-700: #4338ca;
    --gray-900: #111827;
    --gray-700: #374151;
    --gray-500: #6b7280;
    --gray-400: #9ca3af;
    --gray-200: #e5e7eb;
    --gray-100: #f3f4f6;
    --green: #15803d;
    --red: #dc2626;
    --radius-lg: 18px;
    --radius-md: 10px;
    --radius-sm: 8px;
    --mono: 'JetBrains Mono', Consolas, Monaco, 'Courier New', monospace;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    justify-content: center;
    padding: 24px 16px 48px;
    min-height: 100vh;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--gray-700);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.app {
    width: 100%;
    max-width: 680px;
}

/* ---------------- 头部 ---------------- */
.app-head {
    margin-bottom: 20px;
    text-align: center;
    color: #fff;
}

.app-head h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.app-head p {
    margin: 6px 0 0;
    font-size: 14px;
    opacity: 0.85;
}

/* ---------------- 卡片 ---------------- */
.card {
    margin-bottom: 16px;
    padding: 20px;
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 32px -12px rgba(17, 24, 39, 0.35);
}

.card[hidden] {
    display: none;
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.card-head h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-900);
}

.hint {
    font-size: 12px;
    color: var(--gray-400);
}

/* ---------------- 输入区 ---------------- */
.source {
    display: block;
    width: 100%;
    padding: 12px 14px;
    font-family: inherit;
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-900);
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    resize: vertical;
    min-height: 84px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.source::placeholder {
    color: var(--gray-400);
}

.source:focus {
    outline: none;
    border-color: var(--indigo-600);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.action-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.counter {
    margin-right: auto;
    font-size: 12px;
    color: var(--gray-400);
}

/* ---------------- 按钮 ---------------- */
.btn {
    height: 38px;
    padding: 0 18px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn-sm {
    height: 30px;
    padding: 0 12px;
    font-size: 13px;
}

.btn-ghost {
    color: var(--gray-500);
    background: #fff;
    border-color: var(--gray-200);
}

.btn-ghost:hover {
    color: var(--indigo-600);
    border-color: var(--indigo-600);
}

.btn-primary {
    color: #fff;
    background: var(--indigo-600);
}

.btn-primary:hover {
    background: var(--indigo-700);
}

/* ---------------- 状态提示 ---------------- */
.status {
    margin: 12px 0 0;
    padding: 8px 12px;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

.status[hidden] {
    display: none;
}

.status-info {
    color: var(--indigo-600);
    background: #eef2ff;
}

.status-error {
    color: var(--red);
    background: #fef2f2;
}

.status-success {
    color: var(--green);
    background: #dcfce7;
}

/* ---------------- 译文 ---------------- */
.result-text {
    display: block;
    width: 100%;
    margin: 0;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 17px;
    line-height: 1.7;
    color: var(--gray-900);
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    word-break: break-word;
    white-space: pre-wrap;
    resize: vertical;
    min-height: 96px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.result-text::placeholder {
    color: var(--gray-400);
}

.result-text:focus {
    outline: none;
    border-color: var(--indigo-600);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

/* ---------------- 命名风格 ---------------- */
.style-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.style-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid var(--gray-100);
}

.style-item:first-child {
    border-top: none;
}

.style-label {
    flex: 0 0 118px;
    font-size: 12px;
    color: var(--gray-400);
    font-family: var(--mono);
}

.style-value {
    flex: 1;
    min-width: 0;
    font-family: var(--mono);
    font-size: 14px;
    color: var(--gray-900);
    word-break: break-all;
}

.style-item .btn {
    flex: 0 0 auto;
}

/* ---------------- 移动端 ---------------- */
@media (max-width: 480px) {
    body {
        padding: 16px 10px 32px;
    }

    .card {
        padding: 16px;
    }

    .app-head h1 {
        font-size: 20px;
    }

    .style-label {
        flex-basis: 96px;
        font-size: 11px;
    }
}
