* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; background: #f8f9fa; min-height: 100vh; color: #333; }

/* 登录页 */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #f8f9fa; }
.login-box { background: #fff; padding: 40px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); width: 380px; }
.login-title { font-size: 20px; font-weight: 600; text-align: center; margin-bottom: 6px; color: #1a1a1a; }
.login-subtitle { font-size: 13px; text-align: center; color: #888; margin-bottom: 28px; }
.login-input { width: 100%; padding: 12px 14px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; margin-bottom: 16px; outline: none; transition: border-color 0.2s; }
.login-input:focus { border-color: #0066cc; }
.login-btn { width: 100%; padding: 12px; background: #0066cc; color: #fff; border: none; border-radius: 6px; font-size: 14px; font-weight: 500; cursor: pointer; transition: background 0.2s; }
.login-btn:hover { background: #0052a3; }
.login-btn:disabled { background: #ccc; cursor: not-allowed; }
.login-error { color: #dc3545; font-size: 13px; text-align: center; margin-top: 12px; }

/* 后台页 */
.admin-page { display: none; min-height: 100vh; background: #f8f9fa; }
.admin-header { background: #fff; padding: 16px 24px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #e8e8e8; }
.admin-title { font-size: 16px; font-weight: 600; color: #1a1a1a; }
.admin-logout { padding: 8px 16px; background: #fff; border: 1px solid #ddd; border-radius: 6px; font-size: 13px; cursor: pointer; color: #666; transition: all 0.2s; }
.admin-logout:hover { border-color: #dc3545; color: #dc3545; }
.admin-body { max-width: 1000px; margin: 24px auto; padding: 0 24px; }

.card { background: #fff; border-radius: 8px; padding: 24px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.card-title { font-size: 15px; font-weight: 600; color: #1a1a1a; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid #f0f0f0; }

.form-row { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.form-label { font-size: 13px; color: #666; min-width: 80px; }
.form-input { padding: 10px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 13px; outline: none; transition: border-color 0.2s; }
.form-input:focus { border-color: #0066cc; }
textarea.form-input { font-family: inherit; line-height: 1.6; resize: vertical; }

.btn { padding: 8px 16px; border: none; border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.2s; }
.btn-primary { background: #0066cc; color: #fff; }
.btn-primary:hover { background: #0052a3; }
.btn-default { background: #fff; border: 1px solid #ddd; color: #666; }
.btn-default:hover { border-color: #0066cc; color: #0066cc; }
.btn-warning { background: #f0ad4e; color: #fff; }
.btn-warning:hover { background: #ec971f; }
.btn-success { background: #28a745; color: #fff; }
.btn-success:hover { background: #218838; }
.btn-danger { background: #dc3545; color: #fff; }
.btn-danger:hover { background: #c82333; }
.btn-sm { padding: 5px 12px; font-size: 12px; }

.quick-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.result-box { margin-top: 16px; padding: 14px; background: #f8f9fa; border: 1px solid #e8e8e8; border-radius: 6px; font-size: 13px; white-space: pre-wrap; display: none; line-height: 1.7; }
.result-box.success { background: #d4edda; border-color: #c3e6cb; }
.result-box.error { background: #f8d7da; border-color: #f5c6cb; color: #dc3545; }

.stats-bar { display: flex; gap: 24px; margin-bottom: 16px; font-size: 13px; color: #666; padding: 12px 16px; background: #f8f9fa; border-radius: 6px; }
.stats-num { font-weight: 600; }
.status-unused { color: #f0ad4e; }
.status-activated { color: #28a745; }
.status-disabled { color: #dc3545; }
.status-expired { color: #dc3545; font-weight: 600; }
.status-warning { color: #f0ad4e; }
.status-ok { color: #28a745; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 12px 14px; text-align: left; }
th { background: #f8f9fa; font-weight: 600; color: #666; border-bottom: 1px solid #e8e8e8; }
tr { border-bottom: 1px solid #f0f0f0; }
tr:hover { background: #fafbfc; }
.copy-btn { padding: 3px 8px; font-size: 11px; background: #0066cc; color: #fff; border: none; border-radius: 4px; cursor: pointer; margin-left: 6px; }
.copy-btn:hover { background: #0052a3; }
.action-btns { display: flex; gap: 4px; }
.loading-text { text-align: center; padding: 40px; color: #999; font-size: 13px; }

/* 开关 */
.switch { position: relative; display: inline-block; width: 44px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: 0.2s; border-radius: 22px; }
.switch-slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 3px; bottom: 3px; background-color: white; transition: 0.2s; border-radius: 50%; }
.switch input:checked + .switch-slider { background-color: #28a745; }
.switch input:checked + .switch-slider:before { transform: translateX(22px); }

/* 富文本编辑器工具栏 */
.editor-toolbar { display: flex; gap: 4px; margin-bottom: 8px; }
.editor-btn { padding: 6px 10px; background: #fff; border: 1px solid #ddd; border-radius: 4px; font-size: 12px; cursor: pointer; color: #666; }
.editor-btn:hover { border-color: #0066cc; color: #0066cc; }
.editor-btn.active { background: #0066cc; color: #fff; border-color: #0066cc; }

/* 公告预览 */
.announcement-preview { margin-top: 12px; padding: 16px; background: #fff; border: 1px solid #e8e8e8; border-radius: 6px; }
.announcement-preview-title { font-weight: 600; margin-bottom: 8px; }
.announcement-preview-content { font-size: 13px; line-height: 1.7; }
