/* 全局重置与基础样式 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    padding: 10px;
}

/* 容器：让内容在手机上有边距，不贴边 */
.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #007cba;
}

/* 表单样式 */
form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

input[type="text"],
input[type="date"],
input[type="file"],
select {
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 16px; /* 防止iOS缩放 */
    width: 100%;
}

button {
    padding: 12px;
    background-color: #007cba;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

button:hover {
    background-color: #005a87;
}

/* 搜索结果 / 列表页面 */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 14px;
}

table, th, td {
    border: 1px solid #ddd;
    text-align: left;
}

th, td {
    padding: 10px;
    word-break: break-all; /* 防止长文本撑开 */
}

th {
    background-color: #f8f9fa;
    font-weight: bold;
}

/* 图片预览 */
img {
    max-width: 100px;
    height: auto;
    display: block;
}

/* PDF 链接样式 */
a {
    color: #007cba;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* 错误与成功提示 */
p {
    margin: 10px 0;
    font-size: 14px;
}

p[style*="red"] {
    color: red;
}

p[style*="green"] {
    color: green;
}

/* 返回链接 */
a[href^="index"] {
    display: inline-block;
    margin-bottom: 15px;
    font-weight: bold;
}

/* 响应式：手机端优化 */
@media (max-width: 600px) {
    body {
        padding: 5px;
    }

    .container {
        padding: 15px;
    }

    h2 {
        font-size: 20px;
    }

    table {
        font-size: 12px;
    }

    th, td {
        padding: 8px 4px;
    }

    input, button, select {
        font-size: 16px; /* 防止 iOS 自动缩放 */
    }

    /* 表格在手机上可能太窄，可以横向滚动 */
    table {
        overflow-x: auto;
        display: block;
        white-space: nowrap;
    }

    /* 或者更简单的：让表格每行内容不换行，但字体小一点 */
}
