/* --- Global Styles --- */
html {
    height: 100%;
}
body {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
}
.content-wrapper {
    flex: 1 0 auto;
    padding-bottom: 40px; 
}
.container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}
h2 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
}

/* --- Forms & Inputs --- */
form {
    display: flex;
    flex-direction: column;
}
label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}
input[type="text"],
input[type="password"],
input[type="number"],
input[type="file"] {
    width: 100%;
    padding: 10px;
    margin-bottom: 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
}

/* --- Buttons & Links --- */
button,
input[type="submit"] {
    padding: 12px 15px;
    border: none;
    border-radius: 4px;
    background-color: #007bff;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: background-color: 0.3s;
    width: 100%;
    box-sizing: border-box;
}
button:hover,
input[type="submit"]:hover {
    background-color: #0056b3;
}
a {
    display: inline-block;
    margin: 10px 5px;
    padding: 10px 15px;
    background-color: #4CAF50;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color: 0.3s;
}
a:hover {
    background-color: #45a049;
}
a.button-danger, .button-danger {
    background-color: #f44336;
}
a.button-danger:hover, .button-danger:hover {
    background-color: #d32f2f;
}

/* --- Tables (for data.php) --- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}
th, td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}
th {
    background-color: #f2f2f2;
    font-weight: bold;
}
tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* --- Page-specific adjustments --- */
.message {
    text-align: center;
    margin-bottom: 20px;
    padding: 10px;
    border-radius: 4px;
}
.message.success {
    color: #155724;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
}
.message.error {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
}

/* --- 页脚导航样式 --- */
.page-footer {
    text-align: center;
    margin-top: 30px;
    padding-bottom: 20px;
}
.page-footer a {
    background-color: #6c757d;
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    margin: 0 10px;
    border-radius: 5px;
    transition: background-color: 0.3s;
}
.page-footer a:hover {
    background-color: #5a6268;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .container {
        width: 95%;
        padding: 15px;
        margin-top: 10px;
    }
}

/* --- 全局网站页脚样式 --- */
.site-footer {
    flex-shrink: 0;
    background-color: #fff;
    border-top: 1px solid #eee;
    /* [核心修正] 增加左右内边距，避免内容在小屏上紧贴屏幕边缘 */
    padding: 20px 10px;
    text-align: center; /* 当内容换行时，保证文本居中 */
    
    /* --- 使用 Flexbox 实现完美居中 --- */
    display: flex;
    justify-content: center; /* 水平居中 */
    align-items: center;     /* 垂直居中 */
    flex-wrap: wrap;         /* 在极端情况下允许换行 */

    /* [核心修正] 使用 clamp 实现响应式间距，根据屏幕宽度在 15px 到 25px 之间自动调整 */
    gap: clamp(15px, 4vw, 25px);
}

.site-footer span {
    color: #888;
    /* [核心修正] 使用 clamp 实现响应式字体，大小在 12px 到 14px 之间根据屏幕宽度平滑过渡 */
    font-size: clamp(0.75rem, 3vw, 0.875rem); /* 1rem 通常是 16px */
}