/* ROOH开发者工具 公共样式(全站唯一一份, 各页面只留自己的特有样式) */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f5f7fa; color: #333; min-height: 100vh; }
.container { max-width: 600px; margin: 0 auto; padding: 16px 14px; }
h1 { font-size: 20px; font-weight: 600; margin-bottom: 14px; color: #1a1a2e; text-align: center; }
.subtitle { font-size: 13px; color: #888; margin-bottom: 16px; line-height: 1.5; }
.top-bar { display: flex; justify-content: space-between; margin-bottom: 8px; }
.top-bar a { color: #4f6ef7; font-size: 13px; text-decoration: none; }

.card { background: #fff; border-radius: 10px; padding: 18px 16px; margin-bottom: 14px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }

/* 表单 */
.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; color: #555; margin-bottom: 4px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 9px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 16px; background: #fff; }
.form-group textarea { font-size: 16px; min-height: 50px; resize: vertical; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: #4f6ef7; }
.form-row { display: flex; gap: 10px; }
.form-row .form-group { flex: 1; }
.row { display: flex; gap: 10px; }
.row .form-group { flex: 1; }
.req { color: #f44336; }
.sec { font-size: 11px; font-weight: 600; color: #999; letter-spacing: 1px; margin: 14px 0 8px; padding-bottom: 4px; border-bottom: 1px solid #f0f0f0; }
.sec:first-of-type { margin-top: 0; }

/* 按钮 */
.btn { width: 100%; padding: 12px; border: none; border-radius: 8px; font-size: 15px; font-weight: 500; cursor: pointer; transition: all .2s; margin-bottom: 8px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: #4f6ef7; color: #fff; }
.btn-warn { background: #ff9800; color: #fff; }
.btn-info { background: #00bcd4; color: #fff; }
.btn-success { background: #4caf50; color: #fff; }
.btn-purple { background: #9c27b0; color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 12px; width: auto; margin: 4px 4px 4px 0; }
.btn-check { margin-top: 6px; padding: 4px 10px; font-size: 11px; border: 1px solid #4f6ef7; background: #fff; color: #4f6ef7; border-radius: 6px; cursor: pointer; }
.btn-check:disabled { opacity: .5; }

/* 状态条 */
.status-bar { padding: 12px 14px; border-radius: 8px; font-size: 14px; margin-top: 10px; display: none; line-height: 1.6; white-space: pre-wrap; word-break: break-all; }
.status-bar.info { display: block; background: #eef3ff; color: #3b5998; }
.status-bar.success { display: block; background: #edf9ee; color: #2e7d32; }
.status-bar.error { display: block; background: #fdecea; color: #c62828; }

/* 标签页 */
.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.tab { flex: 1; padding: 10px; border: 2px solid #ddd; border-radius: 8px; background: #fff; font-size: 14px; cursor: pointer; color: #666; }
.tab.active { border-color: #4f6ef7; background: #eef3ff; color: #4f6ef7; font-weight: 600; }
#activeCount { font-size: 11px; color: #f44336; font-weight: 700; }

/* 工单进度步骤条 */
.steps { display: flex; align-items: center; gap: 2px; margin: 6px 0 2px; }
.step { display: flex; align-items: center; font-size: 10px; color: #bbb; }
.step .dot { width: 16px; height: 16px; border-radius: 50%; background: #e0e0e0; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 9px; margin-right: 3px; }
.step.done .dot { background: #4caf50; }
.step.done { color: #4caf50; }
.step.active .dot { background: #4f6ef7; animation: blink 1.2s infinite; }
.step.active { color: #4f6ef7; font-weight: 600; }
.step-line { width: 14px; height: 2px; background: #e0e0e0; margin: 0 4px; }
.step-line.done { background: #4caf50; }
@keyframes blink { 0%,100% { opacity: 1 } 50% { opacity: .35 } }

/* 徽标 / 提示 / 空态 */
.badge { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px; }
.hint { font-size: 11px; color: #999; margin-top: 8px; line-height: 1.6; }
.note { font-size: 11px; color: #999; text-align: center; margin-top: 10px; line-height: 1.6; }
.empty { text-align: center; color: #999; padding: 24px 10px; font-size: 13px; }

/* 加载 */
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: spin .6s linear infinite; vertical-align: middle; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-box { text-align: center; color: #999; font-size: 13px; padding: 40px 0; }

/* Toast */
.toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); padding: 10px 20px; border-radius: 8px; font-size: 14px; color: #fff; z-index: 9999; opacity: 0; transition: opacity .3s; pointer-events: none; max-width: 90%; text-align: center; box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.toast.show { opacity: 1; }
.toast.success { background: #4caf50; }
.toast.error { background: #f44336; }
.toast.info { background: #2196f3; }

/* 工单卡片(在办列表) */
.history-item { position: relative; padding: 10px 30px 10px 12px; border: 1px solid #eee; border-radius: 6px; margin-bottom: 8px; cursor: pointer; transition: all .15s; }
.history-item:hover { border-color: #4f6ef7; background: #f8faff; }
.history-item:active { background: #eef3ff; }
.hi-del { position: absolute; top: 8px; right: 8px; width: 20px; height: 20px; border: none; background: #eee; color: #999; border-radius: 50%; font-size: 11px; cursor: pointer; display: flex; align-items: center; justify-content: center; line-height: 1; }
.hi-del:hover { background: #f44336; color: #fff; }
.hi-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 3px; }
.hi-uid { font-weight: 600; font-size: 14px; color: #1a1a2e; }
.hi-time { font-size: 11px; color: #999; }
.hi-problem { font-size: 12px; color: #666; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-del { position: absolute; top: 8px; right: 8px; width: 20px; height: 20px; border: none; background: #eee; color: #999; border-radius: 50%; font-size: 11px; cursor: pointer; line-height: 1; }
.t-del:hover { background: #f44336; color: #fff; }

/* 归档工单列表 */
.t-item { padding: 12px; border: 1px solid #eee; border-radius: 8px; margin-bottom: 10px; cursor: pointer; transition: all .15s; text-decoration: none; display: block; }
.t-item:hover { border-color: #4f6ef7; background: #f8faff; }
.t-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.t-uid { font-weight: 600; font-size: 14px; color: #1a1a2e; }
.t-time { font-size: 11px; color: #999; }
.t-problem { font-size: 12px; color: #666; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* 日志工单页: 天数加减按钮(common.js 动态注入) */
.days-stepper { display: flex; gap: 6px; }
.days-stepper input { flex: 1; text-align: center; }
.days-stepper input::-webkit-outer-spin-button, .days-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.days-stepper input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.stepper-btn { flex: none; width: 42px; border: 1px solid #ddd; border-radius: 6px; background: #fff; font-size: 17px; line-height: 1; color: #4f6ef7; cursor: pointer; }
.stepper-btn:active { background: #f0f2ff; border-color: #4f6ef7; }
