/* Base reset */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Arial, "Noto Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f5f6f8;
    color: #0f172a;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.page {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 16px 48px;
}

.card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05), 0 8px 24px rgba(15,23,42,0.06);
    padding: 20px;
}

.form-card { margin-bottom: 16px; }

h2 { margin: 0 0 12px; font-size: 16px; font-weight: 600; color: #0f172a; }

.form {
    display: grid;
    gap: 12px;
}

textarea.message-input {
    width: 100%;
    min-height: 120px;
    resize: vertical;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 15px;
    line-height: 1.5;
    color: #0f172a;
    background: #ffffff;
}

textarea.message-input::placeholder { color: #94a3b8; }

textarea.message-input:focus {
    outline: none;
    border-color: #94a3ff;
    box-shadow: 0 0 0 4px rgba(59,130,246,0.15);
}

.actions { display: flex; align-items: center; gap: 10px; justify-content: space-between; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 16px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: #111827;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn:hover { background: #0b1220; }

.btn:active { transform: translateY(0.5px); }

.btn.btn-outline {
    background: #ffffff;
    color: #111827;
    border-color: #e5e7eb;
    transition: all 0.2s ease;
}

.btn.btn-outline:hover {
    background: #f8fafc;
    border-color: #d1d5db;
}

.counter { color: #64748b; font-size: 13px; margin-left: auto; }

.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 12px;
    font-size: 14px;
}

.list { display: grid; gap: 12px; margin-top: 16px; }

.item { display: grid; gap: 8px; }

.meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 8px 12px;
    color: #475569;
    font-size: 13px;
}

.meta .kv { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 8px 10px; }
.meta .kv .k { color: #64748b; display: block; font-size: 12px; }
.meta .kv .v { color: #0f172a; word-break: break-word; }

.message-text {
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #0f172a;
    font-size: 15px;
}

.details {
    margin-top: 6px;
}

summary {
    list-style: none;
    cursor: pointer;
    color: #374151;
}
summary::-webkit-details-marker { display: none; }

code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }
pre {
    margin: 8px 0 0;
    padding: 10px 12px;
    background: #0b1220;
    color: #e5e7eb;
    border-radius: 12px;
    overflow: auto;
    border: 1px solid #1f2937;
}

.footer-note { text-align: center; color: #94a3b8; font-size: 12px; margin-top: 12px; }

/* map */
.map-wrap { margin-top: 8px; }
.map-container {
    width: 100%;
    height: 220px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}
.map-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.btn-map { white-space: nowrap; }

.map-hint {
    margin-top: 8px;
    padding: 8px 12px;
    background: #fef3cd;
    border: 1px solid #fde68a;
    border-radius: 8px;
    font-size: 13px;
    color: #92400e;
    line-height: 1.4;
}

.map-info {
    margin-top: 8px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    font-size: 13px;
    color: #64748b;
}

.map-coords, .map-accuracy {
    margin: 4px 0;
}

.coords-text, .accuracy-text {
    font-weight: 600;
    color: #0f172a;
}

.address-info {
    margin-top: 12px;
    padding: 16px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.address-title {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.address-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 8px;
    line-height: 1.5;
}

.address-item:last-child {
    margin-bottom: 0;
}

.address-label {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    min-width: 120px;
    flex-shrink: 0;
}

.address-text {
    font-size: 13px;
    color: #0f172a;
    word-break: break-word;
    flex: 1;
}

.address-text.loading {
    color: #94a3b8;
    font-style: italic;
}

.address-text.error {
    color: #dc2626;
}

.address-text.success {
    color: #059669;
}

/* 嵌入式地图样式 */
.embedded-map {
    width: 100%;
    height: 300px;
    border: none;
    border-radius: 12px;
}

.map-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 8px;
}

.map-tab {
    flex: 1;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.map-tab.active {
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    font-weight: 600;
}

.map-tab:hover:not(.active) {
    background: rgba(255,255,255,0.5);
}

/* 回复功能样式 */
.reply-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.reply-form-wrap {
    margin-top: 16px;
    padding: 20px;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05), 0 4px 12px rgba(15,23,42,0.04);
}

.reply-form {
    display: grid;
    gap: 16px;
}

.reply-inputs {
    display: grid;
    gap: 16px;
}

/* 昵称输入框 - 完全使用原始样式 */
.nickname-input {
    width: 100%;
    height: 48px;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 15px;
    line-height: 1.5;
    color: #0f172a;
    background: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.nickname-input::placeholder {
    color: #94a3b8;
}

.nickname-input:focus {
    outline: none;
    border-color: #94a3ff;
    box-shadow: 0 0 0 4px rgba(59,130,246,0.15);
}

.nickname-input:hover:not(:focus) {
    border-color: #d1d5db;
}

/* 回复消息输入框 - 完全使用原始textarea样式 */
.reply-message-input {
    width: 100%;
    min-height: 100px;
    resize: vertical;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 15px;
    line-height: 1.5;
    color: #0f172a;
    background: #ffffff;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.reply-message-input::placeholder {
    color: #94a3b8;
}

.reply-message-input:focus {
    outline: none;
    border-color: #94a3ff;
    box-shadow: 0 0 0 4px rgba(59,130,246,0.15);
}

.reply-message-input:hover:not(:focus) {
    border-color: #d1d5db;
}

.reply-actions-bottom {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 4px;
}

.replies-list {
    margin-top: 16px;
    padding: 20px;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05), 0 4px 12px rgba(15,23,42,0.04);
}

.reply-item {
    padding: 16px 0;
}

.reply-item + .reply-item {
    border-top: 1px solid #f1f5f9;
}

.reply-content {
    display: grid;
    gap: 10px;
}

.reply-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.reply-nickname {
    font-weight: 600;
    color: #3b82f6;
    font-size: 15px;
}

.reply-time {
    color: #64748b;
    font-size: 13px;
}

.reply-message {
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #0f172a;
    font-size: 15px;
    line-height: 1.6;
    margin-top: 4px;
}

.btn-toggle-replies {
    position: relative;
}

.btn-toggle-replies.expanded .toggle-text::after {
    content: " ▲";
}

.btn-toggle-replies:not(.expanded) .toggle-text::after {
    content: " ▼";
}

/* 响应式调整 */
@media (max-width: 640px) {
    .reply-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .reply-actions-bottom {
        flex-direction: column-reverse;
    }
    
    .reply-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
} 