/* 工单系统 - 绿色主题，与设计草图一致 */

:root {
    --green-bg: #2d5a27;
    --green-header: #3d7a35;
    --green-light: #4a9c42;
    --green-border: #2a4f24;
    --green-text: #1a3317;
    --white: #fff;
    --gray-bg: #f5f9f4;
    --gray-border: #c8e0c2;
    --danger: #c0392b;
    --shadow: rgba(0,0,0,0.1);
}

* {
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    margin: 0;
    padding: 20px;
    background: var(--green-bg);
    color: var(--green-text);
    min-height: 100vh;
    line-height: 1.5;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 20px var(--shadow);
    overflow: hidden;
}

/* 表头区域 - 绿色 */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: var(--green-header);
    color: var(--white);
}

.header-left { display: flex; align-items: baseline; gap: 12px; }
.header-left .header-meta { font-size: 13px; opacity: 0.95; }
.header h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.header-actions .admin-name {
    margin-right: 8px;
    opacity: 0.95;
    font-size: 14px;
}

.header-title-wrap .header-desc {
    margin: 4px 0 0;
    font-size: 13px;
    opacity: 0.95;
}

/* 登录页 - 游客仅见登录框 */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    width: 100%;
    max-width: 380px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 24px var(--shadow);
    padding: 32px;
}

.login-box h1 {
    margin: 0 0 8px;
    font-size: 1.5rem;
    color: var(--green-header);
    text-align: center;
}

.login-desc {
    margin: 0 0 24px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

.login-form .form-row {
    margin-bottom: 16px;
}

.login-form input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-border);
    border-radius: 6px;
    font-size: 14px;
}

.login-form input:focus {
    outline: none;
    border-color: var(--green-light);
}

.btn-block {
    width: 100%;
    margin-top: 8px;
    padding: 12px;
}

.login-tip {
    margin: 20px 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--gray-border);
    font-size: 12px;
    color: #888;
    text-align: center;
}

/* 按钮 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    border: none;
    background: var(--gray-bg);
    color: var(--green-text);
    border: 1px solid var(--gray-border);
    transition: background 0.2s;
}

.btn:hover {
    background: var(--gray-border);
}

.btn-primary {
    background: var(--green-light);
    color: var(--white);
    border-color: var(--green-border);
}

.btn-primary:hover {
    background: var(--green-header);
    color: var(--white);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    margin-right: 6px;
}

.btn-danger {
    background: #e74c3c;
    color: var(--white);
    border-color: #c0392b;
}

.btn-danger:hover {
    background: var(--danger);
    color: var(--white);
}

.btn-unsold {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.btn-unsold:hover {
    background: #c3e6cb;
    color: #155724;
}

.btn-sold {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.btn-sold:hover {
    background: #f5c6cb;
    color: #721c24;
}

/* 表格 */
.table-wrap {
    overflow-x: auto;
    padding: 20px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table thead {
    background: var(--green-light);
    color: var(--white);
}

.data-table th {
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.data-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--gray-border);
}

.data-table tbody tr:hover {
    background: var(--gray-bg);
}

.data-table .url-cell {
    max-width: 200px;
}

.data-table .sentence-cell {
    max-width: 150px;
}

.data-table a {
    color: var(--green-header);
    text-decoration: none;
}

.data-table a:hover {
    text-decoration: underline;
}

.empty {
    text-align: center;
    color: #666;
    padding: 40px !important;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
}

.badge-done {
    background: #d4edda;
    color: #155724;
}

.badge-pending {
    background: #fff3cd;
    color: #856404;
}

.badge-sensitive {
    background: #f8d7da;
    color: #721c24;
}

.badge-clean {
    background: #d4edda;
    color: #155724;
}

/* 表单 - 与设计草图字段对应 */
.ticket-form {
    padding: 24px;
    max-width: 800px;
}

.form-row {
    margin-bottom: 16px;
}

.form-row label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--green-text);
}

.form-row input[type="text"],
.form-row input[type="url"],
.form-row input[type="password"] {
    padding: 10px 12px;
    border: 1px solid var(--gray-border);
    border-radius: 6px;
    font-size: 14px;
    width: 100%;
}

.form-row input.readonly {
    background: var(--gray-bg);
    color: #666;
}

.form-hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #888;
}

.form-row label .required {
    color: #c0392b;
}

.form-note {
    margin-top: 8px;
}

.form-row-query-status .query-status-group {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px 24px;
}
.form-row-query-status .query-status-item {
    font-size: 14px;
}
.form-row-query-status .query-status-item em {
    font-style: normal;
    color: #666;
    margin-right: 6px;
}
.form-row-query-status .status-query {
    color: var(--green-mid);
    font-weight: 600;
}

.input-with-action {
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-with-action input {
    flex: 1;
    min-width: 0;
}

.btn-auto-get {
    flex-shrink: 0;
    padding: 10px 16px;
    font-size: 14px;
}

.text-muted {
    color: #888;
    font-size: 12px;
}

.form-row input:focus {
    outline: none;
    border-color: var(--green-light);
    box-shadow: 0 0 0 2px rgba(74, 156, 66, 0.2);
}

.full-width {
    width: 100%;
}

.inline-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.inline-group .checkbox-label {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.inline-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--green-light);
}

.inline-input {
    flex: 1;
    min-width: 180px;
}

.form-actions {
    margin-top: 24px;
    display: flex;
    gap: 12px;
}

/* 提示信息 */
.message {
    margin: 0 24px 16px;
    padding: 12px 16px;
    border-radius: 6px;
}

.message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 批量搜索 */
.batch-form-wrap {
    padding: 24px;
}

.batch-search-form .batch-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--gray-border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
}

.batch-search-form .batch-textarea:focus {
    outline: none;
    border-color: var(--green-light);
}

.batch-result-wrap {
    padding: 0 24px 24px;
}

.batch-result-title {
    margin: 0 0 16px;
    font-size: 1.1rem;
    color: var(--green-text);
}

.batch-result-wrap .empty {
    padding: 24px !important;
}

.batch-report {
    margin: 0 0 12px;
    font-size: 15px;
}

.batch-detail {
    margin: 0 0 16px;
    padding-left: 1.5em;
    color: #666;
    font-size: 13px;
}

.batch-detail li {
    margin-bottom: 4px;
}

.baidu-cell {
    white-space: nowrap;
}

.btn-refresh-baidu {
    margin-left: 6px;
    font-size: 12px;
    color: var(--green-header);
}
.btn-refresh-baidu:hover {
    text-decoration: underline;
}

.pagination-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-top: 1px solid var(--gray-border);
}
.pagination-wrap .pagination-left {
    flex: 1;
}
.pagination-wrap .pagination-center {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.pagination-wrap .pagination-right {
    flex: 1;
}
.pagination-wrap .pagination-info {
    margin-right: 8px;
    font-size: 13px;
    color: #666;
}
.pagination-wrap .btn-sm {
    min-width: 32px;
}

.inline-form {
    display: inline;
}
.first-hand-form {
    margin-right: 4px;
}
.first-hand-form:last-of-type {
    margin-right: 0;
}
.first-hand-cell .btn-sm {
    padding: 2px 8px;
    font-size: 12px;
}
.header-links {
    display: inline-flex;
    gap: 6px;
    margin-right: 10px;
}
