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

body {
    font-family: Arial, sans-serif;
    background-color: #1a1a1a;
    padding: 20px;
    min-height: 100vh;
    color: #ffffff;
}

.container {
    max-width: 400px;
    margin: 0 auto;
    background-color: #2d2d2d;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* 页面标题 */
.page-title {
    text-align: center;
    font-size: 18px; /* 不要太大 */
    font-weight: bold;
    color: #ffffff;
    padding: 16px 20px 8px 20px;
    border-bottom: 1px solid #555;
    background-color: #2d2d2d;
    font-family: 'Roboto Mono', 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', 'SimSun', sans-serif;
}

.input-section {
    padding: 30px 20px 20px 20px;
    background-color: #2d2d2d;
}

.input-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 0;
}

.number-input {
    width: 100%;
    height: 80px;
    font-size: 36px;
    text-align: center;
    border: 2px solid #555;
    border-radius: 8px;
    background-color: #404040;
    color: #ffffff;
    transition: all 0.2s ease;
    outline: none;
    font-family: 'Roboto Mono', 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', 'SimSun', monospace;
}

.number-input:focus {
    border-color: #4a90e2;
    background-color: #4a4a4a;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.3);
}

.number-input:valid {
    border-color: #4a90e2;
}

.number-input.focused {
    border-color: #4a90e2 !important;
    background-color: #4a4a4a !important;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.3) !important;
}

.confirm-btn {
    width: 100%;
    height: 60px;
    font-size: 24px;
    font-weight: bold;
    color: white;
    background-color: #007bff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    outline: none;
}

.confirm-btn:hover {
    background-color: #0056b3;
}

.confirm-btn:active {
    background-color: #004085;
    transform: translateY(1px);
}

.keyboard-section {
    padding: 20px;
    background-color: #333333;
    border-top: 1px solid #555;
}

.keyboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 12px;
    max-width: 300px;
    margin: 0 auto;
}

.key-btn {
    height: 60px;
    font-size: 24px;
    font-weight: bold;
    color: #ffffff;
    background-color: #505050;
    border: 2px solid #666;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    outline: none;
    user-select: none;
    font-family: 'Roboto Mono', 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', 'SimSun', sans-serif;
}

.key-btn:hover {
    background-color: #606060;
    border-color: #777;
}

.key-btn:active {
    background-color: #454545;
    transform: translateY(1px);
}

.reset-btn {
    background-color: red !important;
    color: white !important;
    border-color: #d63384 !important;
}

.reset-btn:hover {
    background-color: #b02a5b !important;
    border-color: #b02a5b !important;
}

.confirm-btn-keyboard {
    background-color: #4a90e2 !important;
    color: white !important;
    border-color: #4a90e2 !important;
}

.confirm-btn-keyboard:hover {
    background-color: #357abd !important;
    border-color: #357abd !important;
}

.result-section {
    padding: 30px 20px;
    background-color: #333333;
    border-top: 1px solid #555;
}

.result-display {
    margin-bottom: 25px;
}

.result-line {
    height: 60px;
    line-height: 60px;
    font-size: 32px;
    font-weight: bold;
    text-align: center;
    background-color: #404040;
    border: 2px solid #666;
    border-radius: 8px;
    margin-bottom: 10px;
    color: #ffffff;
    font-family: 'Roboto Mono', 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', 'SimSun', sans-serif;
}

.result-line.clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.result-line.clickable:hover {
    background-color: #4a4a4a;
    border-color: #4a90e2;
}

.calculation-display {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Roboto Mono', 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', 'SimSun', sans-serif;
}

.calculation-gray {
    color: #999999;
    font-weight: normal;
    font-size: 32px;
    font-family: 'Roboto Mono', 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', 'SimSun', monospace;
}

.calculation-result {
    color: #ffffff;
    font-weight: bold;
    font-size: 32px;
    font-family: 'Roboto Mono', 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', 'SimSun', monospace;
}

.result-line:last-child {
    margin-bottom: 0;
}

.copy-btn {
    width: 100%;
    height: 60px;
    font-size: 24px;
    font-weight: bold;
    color: white;
    background-color: #4a90e2;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    outline: none;
}

.copy-btn:hover {
    background-color: #357abd;
}

.copy-btn:active {
    background-color: #2968a3;
    transform: translateY(1px);
}

.copy-btn:disabled {
    background-color: #666666;
    cursor: not-allowed;
}

.download-link {
    display: block;
    text-align: center;
    margin-top: 20px;
    color: #4a90e2;
    text-decoration: underline;
    font-size: 14px;
    cursor: pointer;
}

.download-link:hover {
    color: #72aef3;
}

@media (max-width: 480px) {
    .download-link {
        font-size: 18px;
        margin-top: 14px;
    }
}

/* 弹窗样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background-color: #2d2d2d;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    max-width: 300px;
    width: 90%;
    text-align: center;
    border: 1px solid #555;
}

.modal-content h3 {
    margin: 0 0 20px 0;
    color: #ffffff;
    font-size: 20px;
}

.modal-content input {
    width: 100%;
    height: 50px;
    font-size: 18px;
    text-align: center;
    border: 2px solid #666;
    border-radius: 8px;
    margin-bottom: 20px;
    outline: none;
    box-sizing: border-box;
    background-color: #404040;
    color: #ffffff;
    font-family: 'Roboto Mono', 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', 'SimSun', monospace;
}

.modal-content input:focus {
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.3);
}

.modal-buttons {
    display: flex;
    gap: 10px;
}

.modal-btn {
    flex: 1;
    height: 45px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.cancel-btn {
    background-color: #666666;
    color: white;
}

.cancel-btn:hover {
    background-color: #555555;
}

.confirm-btn-modal {
    background-color: #4a90e2;
    color: white;
}

.confirm-btn-modal:hover {
    background-color: #357abd;
}

/* 复制通知弹窗样式 */
.copy-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    pointer-events: none;
}

.copy-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-content {
    background-color: #2d2d2d;
    border: 2px solid #4a90e2;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    min-width: 280px;
    max-width: 400px;
}

.notification-title {
    color: #4a90e2;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.notification-text {
    color: #ffffff;
    font-size: 14px;
    line-height: 1.5;
    font-family: 'Roboto Mono', 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', 'SimSun', monospace;
    background-color: #404040;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #666;
    white-space: pre-line;
    word-break: break-all;
}

/* 移动端优化 */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .container {
        max-width: 100%;
    }
    
    .input-section {
        padding: 20px 15px 15px 15px;
    }
    
    .result-section {
        padding: 20px 15px;
    }
    
    .keyboard-section {
        padding: 15px;
    }
    
    .keyboard-grid {
        gap: 10px;
        max-width: 280px;
    }
    
    .key-btn {
        height: 55px;
        font-size: 22px;
    }
    
    .number-input {
        height: 70px;
        font-size: 32px;
    }
    
    .confirm-btn, .copy-btn {
        height: 55px;
        font-size: 22px;
    }
    
    .result-line {
        height: 55px;
        line-height: 55px;
        font-size: 28px;
    }
    
    .calculation-gray {
        font-size: 28px;
    }
    
    .calculation-result {
        font-size: 28px;
    }
    
    /* 移动端通知弹窗优化 */
    .copy-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        right: 10px;
    }
    
    .notification-content {
        min-width: auto;
        max-width: none;
        padding: 15px;
    }
    
    .notification-title {
        font-size: 16px;
    }
    
    .notification-text {
        font-size: 12px;
        padding: 10px;
    }
}

/* Footer样式 */
.footer {
    width: 100%;
    padding: 24px;
    text-align: center;
    font-size: 14px;
    color: #999999;
    background-color: #1a1a1a;
    margin-top: 20px;
}

.footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
}

.footer-logo-img {
    height: 48px;
    width: 48px;
}

.footer-text {
    margin-bottom: 4px;
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', 'SimSun', sans-serif;
}

.footer-text:last-child {
    margin-bottom: 0;
}

/* 移动端Footer优化 */
@media (max-width: 480px) {
    .footer {
        padding: 20px 15px;
        font-size: 12px;
        margin-top: 15px;
    }
    
    .footer-logo {
        margin-bottom: 12px;
    }
    
    .footer-logo-img {
        height: 40px;
        width: 40px;
    }
}
