* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 10px;
    color: #333;
}

.container {
    width: 100%;
    height: calc(100vh - 20px);
    max-height: 100vh;
    margin: 0;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.15);
    padding: 30px;
    animation: fadeIn 0.5s ease-in;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

header {
    text-align: center;
    margin-bottom: 20px;
    flex-shrink: 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.header-icon {
    font-size: 3em;
    margin-bottom: 8px;
    display: inline-block;
    animation: iconFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 2px 4px rgba(102, 126, 234, 0.2));
}

@keyframes iconFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

header h1 {
    font-size: 2em;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.subtitle {
    color: #888;
    font-size: 0.95em;
    font-weight: 400;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    gap: 16px;
}

.input-section,
.output-section {
    flex-shrink: 0;
}

.input-section label,
.output-section label {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-weight: 600;
    color: #444;
    font-size: 0.95em;
    gap: 8px;
}

.input-section label::before,
.output-section label::before {
    content: '';
    width: 4px;
    height: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

textarea {
    width: 100%;
    padding: 14px;
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    font-size: 15px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    resize: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 70px;
    max-height: 90px;
    line-height: 1.6;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.08);
    transform: translateY(-1px);
}

#chinese-input {
    background: linear-gradient(to bottom, #fafbfc 0%, #f8f9fa 100%);
}

#output {
    background: linear-gradient(to bottom, #f0f4ff 0%, #e8ecff 100%);
    font-weight: 500;
    color: #2d3748;
}

.options-section {
    background: linear-gradient(to bottom, #fafbfc 0%, #f8f9fa 100%);
    padding: 16px;
    border-radius: 12px;
    flex-shrink: 0;
    border: 1px solid #e8e8e8;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.option-group {
    margin-bottom: 14px;
}

.option-group:last-child {
    margin-bottom: 0;
}

.option-group > label:first-child {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #444;
    font-size: 0.92em;
    letter-spacing: 0.3px;
}

.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.radio-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 16px;
    background: white;
    border-radius: 8px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    font-size: 0.88em;
    border: 2px solid transparent;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: relative;
}

.radio-group label:hover {
    background: #f0f4ff;
    border-color: #e0e8ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.15);
}

.radio-group input[type="radio"]:checked + span {
    color: #667eea;
    font-weight: 600;
}

.radio-group input[type="radio"]:checked {
    accent-color: #667eea;
}

.radio-group label:has(input[type="radio"]:checked),
.radio-group input[type="radio"]:checked ~ * {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8ecff 100%);
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

/* 兼容性：如果浏览器不支持:has()，使用JavaScript添加类 */
.radio-group label.checked {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8ecff 100%);
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.radio-group input[type="radio"] {
    margin-right: 8px;
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.option-group label:not(:first-child) {
    display: flex;
    align-items: center;
    margin-right: 20px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.88em;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.option-group label:not(:first-child):hover {
    background: #f0f4ff;
}

.option-group input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.convert-btn {
    width: auto;
    min-width: 120px;
    padding: 10px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    box-shadow: 0 3px 15px rgba(102, 126, 234, 0.3);
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
    align-self: center;
    margin: 0 auto;
}

.convert-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.convert-btn:hover::before {
    left: 100%;
}

.convert-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.45);
}

.convert-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.35);
}

.convert-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.output-container {
    position: relative;
}

.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    pointer-events: all;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.copy-btn:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3d8f 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.copy-btn:active {
    transform: scale(0.95);
}

.copy-btn.copied {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.examples-section {
    flex-shrink: 0;
    padding-top: 12px;
    border-top: 2px solid #f0f0f0;
}

.examples-section h3 {
    margin-bottom: 10px;
    color: #444;
    font-size: 0.92em;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.examples {
    display: flex;
    flex-direction: row;
    gap: 10px;
    flex-wrap: wrap;
}

.example-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: linear-gradient(to bottom, #fafbfc 0%, #f8f9fa 100%);
    border-radius: 10px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    flex: 1;
    min-width: 160px;
    border: 1px solid #e8e8e8;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.example-item:hover {
    background: linear-gradient(to bottom, #f0f4ff 0%, #e8ecff 100%);
    border-color: #667eea;
    cursor: pointer;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.example-chinese {
    font-weight: 600;
    color: #667eea;
    font-size: 0.9em;
}

.arrow {
    color: #bbb;
    font-size: 1.1em;
    font-weight: 300;
}

.example-english {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    color: #2d3748;
    font-weight: 500;
    font-size: 0.9em;
}

footer {
    flex-shrink: 0;
    text-align: center;
    color: #aaa;
    font-size: 0.8em;
    padding-top: 12px;
    margin-top: auto;
    border-top: 1px solid #f0f0f0;
}

.beian-info {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}

.beian-info a {
    color: #888;
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 0.85em;
}

.beian-info a:hover {
    color: #667eea;
    text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    header h1 {
        font-size: 2em;
    }

    .radio-group {
        flex-direction: column;
        gap: 10px;
    }

    .copy-btn {
        position: static;
        width: 100%;
        margin-top: 10px;
        opacity: 1;
        pointer-events: all;
    }
}
