* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow-x: hidden;
}

.container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    flex: 1;
    display: flex;
    flex-direction: column;
}

h1 {
    text-align: center;
    color: #667eea;
    margin-bottom: 10px;
    font-size: clamp(24px, 4vw, 32px);
    font-weight: 700;
    line-height: 1.2;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 14px;
}

.input-section {
    margin-bottom: clamp(20px, 4vw, 30px);
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    position: relative;
}

.input-wrapper {
    flex: 1;
    position: relative;
}

input[type="text"] {
    width: 100%;
    padding: 15px 50px 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 18px;
    transition: all 0.3s ease;
    outline: none;
}

input[type="text"]:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

button {
    padding: 15px 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

button:active {
    transform: translateY(0);
}

.clear-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    box-shadow: none;
}

.clear-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.clear-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.clear-btn svg {
    width: 18px;
    height: 18px;
    stroke: #ffffff;
    stroke-width: 2.5;
    transition: stroke 0.2s ease;
}

.clear-btn:hover svg {
    stroke: #ff4444;
}

.clear-btn.show {
    display: flex;
}

.hint {
    color: #999;
    font-size: 13px;
    margin-top: 5px;
}

.results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 20px;
    margin-top: 30px;
    flex: 1;
}

.result-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    min-height: 120px;
    position: relative;
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* 切换开关样式 */
.toggle-switch {
    position: absolute;
    top: 15px;
    right: 55px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.toggle-label {
    font-size: 11px;
    color: #666;
    font-weight: 600;
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #667eea;
}

input:checked + .slider:before {
    transform: translateX(20px);
}

.slider:hover {
    background-color: #bbb;
}

input:checked + .slider:hover {
    background-color: #5568d3;
}

.copy-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 0;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.copy-btn:active {
    transform: scale(0.95);
}

.copy-btn svg {
    width: 16px;
    height: 16px;
    stroke: #555;
    stroke-width: 2;
    fill: none;
    transition: all 0.2s ease;
}

.copy-btn:hover svg {
    stroke: #333;
}

.copy-btn.copied {
    background: #10b981;
}

.copy-btn.copied svg {
    stroke: white;
}

.result-card.highlight-1 {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
}

.result-card.highlight-2 {
    background: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 100%);
}

.result-card.highlight-3 {
    background: linear-gradient(135deg, #ffd89b 0%, #ff6e7f 100%);
}

.result-card.highlight-4 {
    background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%);
}

.result-label {
    font-size: 14px;
    font-weight: 600;
    color: #555;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-label::before {
    content: "●";
    font-size: 20px;
    color: #667eea;
}

.result-value {
    font-size: clamp(14px, 2.5vw, 18px);
    font-weight: 700;
    color: #333;
    word-wrap: break-word;
    line-height: 1.4;
    min-height: 50px;
    display: flex;
    align-items: center;
    padding-right: 45px;
}

.empty-state {
    text-align: center;
    color: #999;
    padding: clamp(30px, 8vh, 60px) 20px;
    font-size: clamp(14px, 2.5vw, 16px);
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#resultArea {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 200px;
}

.empty-state::before {
    content: "✨";
    display: block;
    font-size: clamp(36px, 5vw, 48px);
    margin-bottom: 15px;
}

/* 提示框样式 */
.hint-box {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.hint-title {
    color: #555;
    font-size: clamp(12px, 2vw, 14px);
    font-weight: 600;
    margin-bottom: 12px;
}

.hint-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.hint-item {
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 20px;
    padding: 6px 12px;
    font-size: clamp(10px, 2vw, 12px);
    color: #667eea;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.hint-item:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.5);
    transform: translateY(-1px);
}

/* 页脚样式 */
.footer {
    text-align: center;
    padding: 20px 0;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.beian-info {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

.beian-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.beian-info a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.beian-info a:hover {
    color: rgba(255, 255, 255, 1);
    text-decoration: underline;
}

/* 响应式设计 */

/* 大屏幕优化 */
@media (min-width: 1200px) {
    .container {
        padding: 50px;
        max-width: 1200px;
    }
    
    .results {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 25px;
    }
}

/* 平板优化 */
@media (max-width: 1024px) {
    .container {
        padding: 35px;
        margin: 10px;
    }
    
    .hint-item {
        max-width: 180px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 15px;
    }
    
    .container {
        padding: 25px;
        margin: 0;
        border-radius: 15px;
    }

    .input-group {
        flex-direction: column;
        gap: 15px;
    }
    
    .input-wrapper {
        width: 100%;
    }

    button {
        width: 100%;
        padding: 18px;
    }

    .results {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .result-card {
        padding: 15px;
        min-height: 100px;
    }
    
    .hint-box {
        padding: 15px;
    }
    
    .hint-examples {
        gap: 6px;
    }

    .hint-item {
        font-size: 11px;
        padding: 5px 10px;
        max-width: 150px;
    }
    
    .toggle-switch {
        right: 45px;
    }
}

/* 手机优化 */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 20px;
        border-radius: 12px;
    }
    
    h1 {
        margin-bottom: 8px;
    }
    
    .subtitle {
        font-size: 12px;
        margin-bottom: 20px;
    }
    
    .input-group {
        gap: 10px;
    }
    
    input[type="text"] {
        padding: 12px 45px 12px 15px;
        font-size: 16px; /* 防止iOS缩放 */
    }
    
    button {
        padding: 15px;
        font-size: 14px;
    }
    
    .clear-btn {
        right: 8px;
        width: 28px;
        height: 28px;
    }
    
    .clear-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .hint-box {
        padding: 12px;
        margin-top: 15px;
    }
    
    .hint-item {
        font-size: 10px;
        padding: 4px 8px;
        max-width: 120px;
    }
    
    .result-card {
        padding: 12px;
        min-height: 90px;
    }
    
    .copy-btn {
        width: 28px;
        height: 28px;
        top: 12px;
        right: 12px;
    }
    
    .toggle-switch {
        top: 12px;
        right: 42px;
    }
    
    .result-value {
        font-size: 14px;
        padding-right: 40px;
        min-height: 40px;
    }
    
    .empty-state {
        padding: 40px 15px;
        font-size: 14px;
    }
    
    .empty-state::before {
        font-size: 36px;
    }
    
    .footer {
        padding: 15px 0;
        margin-top: 30px;
    }
    
    .beian-info {
        font-size: 11px;
        gap: 6px;
    }
}

/* 超小屏幕优化 */
@media (max-width: 360px) {
    .hint-examples {
        justify-content: stretch;
    }
    
    .hint-item {
        flex: 1 1 calc(50% - 4px);
        max-width: none;
        text-align: center;
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
    }
}

/* 横屏优化 */
@media (max-height: 600px) and (orientation: landscape) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 20px;
    }
    
    .hint-box {
        display: none; /* 在高度不足时隐藏提示框 */
    }
    
    .result-card {
        min-height: 80px;
    }
    
    .empty-state {
        padding: 30px 15px;
    }
}
