* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f5f7fa;
    color: #333;
}
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
    background: #2563eb;
    color: #fff;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.topbar h1 { font-size: 18px; margin: 0; }
.topbar a { color: #fff; margin-left: 12px; }

.container {
    max-width: 960px;
    margin: 24px auto;
    padding: 0 16px;
}

/* 登录页 */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-box {
    background: #fff;
    padding: 32px;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    width: 320px;
}
.login-box h1 { font-size: 20px; margin: 0 0 20px; text-align: center; }
.login-box label { display: block; margin-bottom: 12px; font-size: 14px; }
.login-box input {
    width: 100%;
    padding: 8px;
    margin-top: 4px;
    border: 1px solid #ccc;
    border-radius: 4px;
}
.login-box button {
    width: 100%;
    padding: 10px;
    background: #2563eb;
    color: #fff;
    border: 0;
    border-radius: 4px;
    cursor: pointer;
}

/* 表单 */
.form label { display: block; margin-bottom: 16px; }
.form input[type=text], .form input[type=file] {
    width: 100%;
    padding: 8px;
    margin-top: 4px;
    border: 1px solid #ccc;
    border-radius: 4px;
}
.form button {
    padding: 10px 24px;
    background: #2563eb;
    color: #fff;
    border: 0;
    border-radius: 4px;
    cursor: pointer;
}

/* 列表 */
.list { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; }
.list th, .list td { padding: 10px 12px; border-bottom: 1px solid #eee; text-align: left; font-size: 14px; }
.list th { background: #f0f4ff; }
.actions a, .actions button { margin-right: 8px; font-size: 14px; }
.link-btn { background: none; border: 0; color: #dc2626; cursor: pointer; padding: 0; }

/* 标签 */
.tag {
    display: inline-block;
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    margin-right: 4px;
}
.tag.active { background: #2563eb; color: #fff; }
.tag-cloud { margin-bottom: 16px; }

/* 前台列表 */
.course-list { list-style: none; padding: 0; }
.course-list li {
    background: #fff;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.course-list li > a { font-size: 16px; font-weight: 500; }
.course-list .meta { margin-top: 8px; font-size: 13px; color: #666; }
.course-list .time { margin-left: 8px; }

/* 分页 */
.pagination { margin: 20px 0; text-align: center; }
.pagination a {
    display: inline-block;
    padding: 4px 10px;
    margin: 0 2px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
}
.pagination a.active { background: #2563eb; color: #fff; border-color: #2563eb; }

/* 提示 */
.error { color: #dc2626; background: #fee2e2; padding: 8px 12px; border-radius: 4px; }
.flash { color: #166534; background: #dcfce7; padding: 8px 12px; border-radius: 4px; }
.filter { margin-bottom: 16px; }
.filter input { padding: 6px 8px; border: 1px solid #ccc; border-radius: 4px; margin-right: 6px; }
.filter button { padding: 6px 12px; background: #2563eb; color: #fff; border: 0; border-radius: 4px; cursor: pointer; }

.admin-entry {
    position: fixed !important;
    right: 16px !important;
    bottom: 16px !important;
    left: auto !important;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    background: #e5e7eb;
    color: #6b7280;
    border-radius: 50%;
    font-size: 20px;
    text-decoration: none;
    opacity: 0.6;
    z-index: 9999;
    transition: opacity .2s, background .2s, color .2s;
}
.admin-entry:hover {
    opacity: 1;
    background: #2563eb;
    color: #fff;
    text-decoration: none;
}
.admin-entry--active {
    opacity: 1;
    background: #2563eb;
    color: #fff;
}

.back-home {
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
}
.back-home a {
    color: #6b7280;
    text-decoration: none;
}
.back-home a:hover {
    color: #2563eb;
    text-decoration: underline;
}