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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f5f5f5;
    padding: 20px;
    padding-top: 80px; /* 为固定头部留出空间 */
    padding-bottom: 100px; /* 为底部留出空间 */
    min-height: 100vh;
}

.fixed-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #007bff;
    color: white;
    z-index: 1000;
}

.ton-display {
    font-size: 1.2rem;
    font-weight: bold;
}

.view-ratio-btn {
    background-color: #fff;
    color: #007bff;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 0.9rem;
    cursor: pointer;
}

.container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    padding: 8px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.item-label {
    flex: 0 0 70px;
    text-align: left;
    margin-right: 8px;
    word-break: break-all;
    font-size: 0.9rem;
}

.item-input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    width: 100px;
}

.clear-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background-color: #dc3545;
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 6px;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    margin-top: 15px;
    transition: background-color 0.3s;
}

.clear-btn:hover {
    background-color: #c82333;
}

.clear-btn:active {
    transform: translateY(1px);
}

/* 弹出窗口样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 2000;
}

.modal-content {
    position: relative;
    background-color: white;
    margin: 5% auto;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}

.close:hover {
    color: #000;
}

.ratio-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.ratio-table th, .ratio-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.ratio-table th {
    background-color: #f2f2f2;
}

/* 额外空间，防止键盘遮挡 */
.extra-space {
    height: 100px;
    margin-bottom: 50px;
}