﻿:root {
  --bg: #eef7f6;
  --surface: #ffffff;
  --surface-strong: #f6fbfb;
  --text: #17282b;
  --muted: #66787b;
  --line: #d7e6e4;
  --primary: #087f83;
  --primary-dark: #046066;
  --accent: #f2a93b;
  --musician: #0f7cba;
  --planner: #a85535;
  --shadow: 0 16px 45px rgba(14, 66, 70, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(8, 127, 131, 0.12), transparent 38%),
    linear-gradient(315deg, rgba(242, 169, 59, 0.16), transparent 34%),
    var(--bg);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(460px, 100%);
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: 34px;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
}

.login-copy {
  color: var(--muted);
  line-height: 1.7;
}

.login-form,
.post-form,
.chat-form {
  display: grid;
  gap: 14px;
}

label,
.field-stack {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.subsection-title {
  font-size: 14px;
  font-weight: 800;
}

.helper-text {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.6;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 11px 12px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input[type="file"] {
  padding: 9px;
}

textarea {
  resize: vertical;
  min-height: 92px;
}

input:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(8, 127, 131, 0.14);
}

.role-picker {
  margin: 4px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  border: 0;
}

.role-picker legend {
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 800;
}

.role-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.role-option input {
  width: auto;
}

.primary-button,
.secondary-button,
.ghost-button,
.filter-button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  font-weight: 800;
}

.primary-button {
  color: #fff;
  background: var(--primary);
  padding: 0 18px;
}

.primary-button:hover {
  background: var(--primary-dark);
}

.secondary-button {
  color: var(--primary-dark);
  background: #dff2f0;
  padding: 0 16px;
}

.ghost-button {
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
  padding: 0 14px;
}

.app-shell {
  width: min(1420px, 100%);
  margin: 0 auto;
  padding: 22px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 84px;
  margin-bottom: 18px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.topbar h1 {
  margin-bottom: 0;
  font-size: 28px;
}

.session-box {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-weight: 700;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(420px, 1fr) minmax(280px, 340px);
  gap: 18px;
  align-items: start;
}

.profile-panel,
.feed-panel,
.chat-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.profile-panel,
.chat-panel {
  position: sticky;
  top: 18px;
}

.profile-panel,
.feed-panel,
.chat-panel {
  padding: 18px;
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.badge,
.post-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.badge.musician,
.post-badge.musician {
  background: var(--musician);
}

.badge.planner,
.post-badge.planner {
  background: var(--planner);
}

.profile-list {
  display: grid;
  gap: 10px;
  margin: 0 0 16px;
}

.works-list {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.work-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.work-card-title {
  margin: 0;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.work-card audio {
  width: 100%;
  height: 36px;
}

.work-card-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.mini-button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--planner);
  background: #fff;
  font-size: 12px;
  font-weight: 800;
}

.profile-list div {
  display: grid;
  gap: 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 800;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.filter-group {
  display: flex;
  gap: 8px;
}

.filter-button {
  min-height: 34px;
  padding: 0 12px;
  color: var(--muted);
  background: var(--surface-strong);
  border: 1px solid var(--line);
}

.filter-button.active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.post-form {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.post-list {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.post-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.post-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.post-title {
  margin: 0 0 6px;
  font-size: 18px;
}

.post-meta,
.small-muted {
  color: var(--muted);
  font-size: 13px;
}

.post-details {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.detail-pill {
  padding: 6px 9px;
  border-radius: 999px;
  color: var(--primary-dark);
  background: #e7f5f3;
  font-size: 12px;
  font-weight: 800;
}

.post-content {
  margin-bottom: 14px;
  color: #34494d;
  line-height: 1.7;
  white-space: pre-wrap;
}

.empty-chat {
  min-height: 230px;
  display: grid;
  place-items: center;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.chat-box {
  height: 420px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.message {
  max-width: 86%;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.message.mine {
  align-self: flex-end;
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.message strong {
  display: block;
  margin-bottom: 2px;
  font-size: 12px;
}

.chat-form {
  grid-template-columns: 1fr auto;
}

@media (max-width: 1080px) {
  .workspace {
    grid-template-columns: 1fr 1.4fr;
  }

  .chat-panel {
    grid-column: 1 / -1;
    position: static;
  }

  .profile-panel {
    position: static;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 12px;
  }

  .topbar,
  .session-box,
  .panel-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .workspace,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .login-panel {
    padding: 24px;
  }

  .role-picker {
    grid-template-columns: 1fr;
  }
}
/* ---- 作者主页弹窗 ---- */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-content {
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  max-width: 460px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(14,66,70,0.18);
  position: relative;
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: 0;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}
.modal-close:hover {
  color: var(--text);
}

/* ---- 作者链接 ---- */
.author-link {
  cursor: pointer;
  font-weight: 800;
}
.author-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* ---- 未读消息标记 ---- */
.unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  margin-left: 6px;
  vertical-align: middle;
}
/* ---- 联系人列表 ---- */
.contact-list {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  min-height: 200px;
}
.contact-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
  background: #fff;
  transition: background 0.15s;
}
.contact-item:last-child {
  border-bottom: 0;
}
.contact-item:hover {
  background: var(--surface-strong);
}
.contact-info {
  min-width: 0;
}
.contact-title {
  font-size: 14px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.contact-preview {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}
.contact-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.contact-author {
  font-size: 11px;
  color: var(--muted);
}

/* ---- 返回按钮 ---- */
.chat-back {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.chat-back:hover {
  background: var(--surface-strong);
}


/* ---- Contact List Styles ---- */
.contact-list {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  min-height: 200px;
}
.contact-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
  background: #fff;
  transition: background 0.15s;
}
.contact-item:last-child { border-bottom: 0; }
.contact-item:hover { background: var(--surface-strong); }
.contact-title {
  font-size: 14px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.contact-preview {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}
.contact-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  margin-left: 6px;
  vertical-align: middle;
}
.chat-back {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.chat-back:hover { background: var(--surface-strong); }
.author-link { cursor: pointer; font-weight: 800; }
.author-link:hover { color: var(--primary); text-decoration: underline; }

/* ---- Modal Styles ---- */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-content {
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  max-width: 460px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(14,66,70,0.18);
  position: relative;
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: 0;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}
.modal-close:hover { color: var(--text); }
/* ---- 联系人列表 ---- */
.contact-list {
  display: grid;
  gap: 6px;
}
.contact-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  cursor: pointer;
  transition: background 0.15s;
}
.contact-item:hover {
  background: #dff2f0;
}
.contact-name {
  font-size: 14px;
  font-weight: 800;
}

/* ---- 聊天头部 ---- */
.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.chat-header .ghost-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}
