/* 视口设置 */
@viewport {
    width: device-width;
    initial-scale: 1.0;
}

/* 全局样式 */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background-color: #f8f9fa;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

.page-wrapper {
    min-height: 100vh; /* 占满视口 */
    overflow-y: auto; /* 允许整体滚动 */
    display: flex;
    flex-direction: column;
    padding-bottom: 20px; /* 底部留白 */
}

.container {
    width: 95%;
    max-width: 600px;
    margin: 20px auto;
    padding: 15px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.text-center {
    text-align: center;
}

h2 {
    font-size: 1.75rem;
    margin: 1rem 0;
    color: #333;
}

/* 表单组样式 */
.form-group {
    margin-bottom: 1.25rem;
}
.form-group1 {
    margin-bottom: 1rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #444;
}

.form-control {
    /*width: 100%;*/
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-control:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.form-control1 {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-control1:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* 按钮样式 */
.btn {
    display: block;
    width: 100%;
    padding: 14px;
    background-color: #fcd535;
    color: #000;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
}

.btn:hover {
    background-color: #f0b90b;
}

.btn:active {
    transform: scale(0.98);
}

/* 卡片样式 */
.card {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.card h5 {
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    color: #333;
}

/* 错误信息 */
.error-message {
    margin-top: 1rem;
    padding: 12px;
    background-color: #ffe3e3;
    color: #dc3545;
    border: 1px solid #ffc9c9;
    border-radius: 8px;
    font-size: 0.9rem;
}

/* 日志模块样式 */
.log-module {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #f0f0f0;
}

.hidden {
    display: none;
}

/* 移动端优化媒体查询 */
@media (max-width: 480px) {
    .container {
        width: 100%;
        margin: 10px auto;
        border-radius: 0;
    }

    h2 {
        font-size: 1.5rem;
        margin: 0.5rem 0;
    }

    .form-control {
        padding: 14px;
    }

    .btn {
        padding: 16px;
        font-size: 1.05rem;
    }

    .card {
        margin-top: 1rem;
        padding: 1rem;
    }

    input[type="number"] {
        font-size: 16px;
    }
}

/* 横屏优化 */
@media (min-width: 481px) and (max-width: 767px) {
    .container {
        padding: 20px;
    }
}

/* 进一步优化移动端显示 */
@media (max-width: 767px) {
    body {
        font-size: 14px;
    }

    .form-control {
        font-size: 14px;
    }

    .btn {
        font-size: 14px;
    }

    .card h5 {
        font-size: 1rem;
    }
}

/* 隐藏 number 输入框的上下箭头 */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}
a {
    display: inline-flex;
    align-items: center;
    background-color: #f8f9fa;
    padding: 5px 10px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-decoration: none;
    color: #333;
    transition: background-color 0.2s;
}

a:hover {
    background-color: #e2e6ea;
}

a img, a svg {
    width: 24px;
    height: 24px;
    margin-right: 5px;
}
a { position: absolute; top: 10px; right: 10px; }

.button-row {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;       /* 自动换行防止溢出 */
    gap: 10px;
}

.btn-link {
    padding: 8px 16px;
    background-color: #fcd535;
    color: #000;
    border-radius: 4px;
    text-decoration: none;
    text-align: center;
    display: inline-block;
    font-size: 1rem;
    min-width: 23%;        /* 统一按钮宽度 */
    transition: background-color 0.2s ease;
    position: static !important;  /* 强制取消定位 */
}

.btn-link:hover {
    background-color: #f0b90b;
}

.modal-overlay {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.modal-img {
    max-width: 80vw;    /* 最大宽度为视口宽度的80% */
    max-height: 80vh;   /* 最大高度为视口高度的80% */
    width: auto;        /* 宽度自动，保持比例 */
    height: auto;       /* 高度自动，保持比例 */
    border-radius: 6px;
    box-shadow: 0 0 10px rgba(0,0,0,0.5); /* 加个阴影更美观 */
    display: block;
    margin: 0 auto;
}

.close-btn {
    position: absolute;
    top: -20px;
    right: -20px;
    color: white;
    font-size: 28px;
    cursor: pointer;
}

